Problem with WPF Series Coloring
Posted: Wed Oct 29, 2008 9:11 pm
I am trying to upgrade my TChart from WinForms to WPF in our application. In the original app, I would override the DrawValue method on the Bar Series for our Volume Bars in order to give each bar a different color depending on the whether the Price is up or down. The code below worked great in the WinForms version (I replaced our logic with the Mod symbol to give you the same kind of effect). When I do this in the new WPF version, though, the app becomes very slow when showing a large number of data points (somewhere around 2000). I am assuming something has changed, maybe it is new-ing up a bunch of brushes? Is there a workaround to make this work again...
Also, I am having a hard time with all the methods in the TChart code, that don't show the summary of what the methods actually do. Could you guys start filling in the Summaries, so I have an idea of what effect calling a method will have. There are like a million methods and I have no idea what most of them do.
Thanks,
T-Mac
Code: Select all
Public Overrides Sub DrawValue(ByVal valueIndex As Integer)
If valueIndex Mod 3 = 0 Then
Me.Color = Windows.Media.Colors.Green
ElseIf valueIndex Mod 2 = 0 Then
Me.Color = Windows.Media.Colors.Red
Else
Me.Color = Windows.Media.Colors.Yellow
End If
MyBase.DrawValue(valueIndex)
End Sub
Thanks,
T-Mac