Hello, I'm trying to implement a tooltip on the legend of my winchart but its not working out...
I'm wanting to set up where, if I click on a label on the legend, the line on the chart will bold and then it checks to see if the line of the chart is bold in CHARTDRAWITEM and bold the label on the legend. But for some reason, when I click the first label, it would bold everything. I think I know the problem but I'm not sure how to fix this. Please help me out.
Private Sub ChartDrawItem(ByVal sender As System.Object, ByVal e As Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs)
If e.Primitive.Path IsNot Nothing AndAlso e.Primitive.Path.IndexOf("Legend") <> -1 Then
If e.Primitive.Row > -1 AndAlso e.Primitive.Column > -1 Then
e.Primitive.Caps = Infragistics.UltraChart.Core.Primitives.PCaps.HitTest Or Infragistics.UltraChart.Core.Primitives.PCaps.Tooltip
If e.Primitive.Path IsNot Nothing AndAlso e.Primitive.Path.ToLower.Contains("legend") Then
If TypeOf (e.Primitive) Is Box Then
LastPrimitive = e.Primitive
e.Primitive.Column = 0
ElseIf TypeOf (e.Primitive) Is Text Then
Dim t As Text = CType(e.Primitive, Infragistics.UltraChart.Core.Primitives.Text)
e.Primitive.Row = LastPrimitive.Row
e.Primitive.Column = LastPrimitive.Column
e.Primitive.Value = LastPrimitive.Value
End If
If Me.tcResults.SelectedIndex < Me.charts.Count AndAlso _
TypeOf (e.Primitive) Is Infragistics.UltraChart.Core.Primitives.Text Then
Dim chart As UltraWinChart.UltraChart = charts(Me.tcResults.SelectedIndex)
Dim colNum As Integer = e.Primitive.Column
'colNum = 1
If colNum >= 0 AndAlso _
chart.LineChart.LineAppearances.Count > colNum AndAlso _
chart.LineChart.LineAppearances(colNum).Thickness = 8 Then
Dim pText As Infragistics.UltraChart.Core.Primitives.Text = DirectCast(e.Primitive, Infragistics.UltraChart.Core.Primitives.Text)
Dim tFont As Font = pText.labelStyle.Font
pText.labelStyle.Font = New Font(tFont.FontFamily, tFont.Size, FontStyle.Bold)
Else
e.Primitive.PE.Fill = Color.White
e.Primitive.Caps = Infragistics.UltraChart.Core.Primitives.PCaps.None
e.Primitive.Chart = Infragistics.UltraChart.Shared.Styles.ChartType.LineChart
End Sub
Hello Ninix,
Maybe one possible approach to achieve desired bahvior could be if you are using events:
- ultraChart1_DataItemOver()
- ultraChart1_FillSceneGraph()
Please take a look at the attached sample for more details and let me know if you have any questions
Regards
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. Let me know if you have any questions.