Hi,
i found in this forum a solution for make a new line in a winchart, now i want add a tooltip when the mouse is over this line, need help, tjhis is the code for create a line:
Private Sub UltraChart1_FillSceneGraph(sender As Object, e As Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs) Handles UltraChart1.FillSceneGraph Dim media As Double = 0 Dim linea As Infragistics.UltraChart.Core.Primitives.Line Try Dim x As Infragistics.UltraChart.Core.IAdvanceAxis = e.Grid("X") Dim y As Infragistics.UltraChart.Core.IAdvanceAxis = e.Grid("Y") media = UltraGrid1.DisplayLayout.Rows.SummaryValues("m" & UltraGrid1.DisplayLayout.Bands(0).Columns(UltraComboTestate.Value).Key).Value linea = New Infragistics.UltraChart.Core.Primitives.Line(New Point(x.Map(0), y.Map(media)), New Point(x.Map(50), y.Map(media))) linea.PE.Stroke = Color.Red e.SceneGraph.Add(linea) Catch ex As Exception End Try End Sub
tks for help
Hello,
Yes, adding tooltips is built-in and exposed from the line primitive you're creating. Try including the Caps property and setting this to Tooltip after setting the Stroke.
//example
linea.PE.Stroke = Color.Redlinea.Caps = PCaps.Tooltip.
This will show a tooltip over the datapoints you have along the line.
Let me know if you have any quesitons regading this matter.
Hi tks, for ans,
i set the caps but i dont have datapoints along the line, because its an average line, i calculate the average of all datas and draw this line.
i want a tooltip that say something like :"The average is:" & average
tks
I've attached a sample that uses a box primitive to construct a threshold line and created a class that implements IRenderLabel CustomToolTips to display the custom text for the tooltip. This primitive is filled with a color with a double value assigned. The chart.Tooltips.Overflow = TooltipOverflow.ChartArea is set to keep them drawn inside the chart area. The ToString implementation in the custom class looks for the added primitive and generates the string accordingly. The Row and Column have been set to -1 since this primitive isn’t actually a representation of something in the data.
For more details, please review my sample and let me know if you have any questions.
Hello Gothrek,
Yes, I agree. Since there isn't a built-in way to achieve this I recommend submitting a feature request.
You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
Let me know if you have any additional questions regarding this matter.
i m not very happy about this solution, its a bit complicate, only for add a tooltip, maybe in a future version something more easy.