3

I have a problem when I change the color of a series in a CartesianChart, the color of the legend doesn't change. I created my custom legend, as explained in the part "Customize Tooltip" but without success.

I tried to modify the stroke value using this line code :

CustomersLegend.Get().Series[0].Stroke =  ....

but, again, without success.

wonea
  • 4,783
  • 17
  • 86
  • 139
bobbinch
  • 51
  • 4

1 Answers1

1

A year old question, but here we go.
If you have your series defined in your XAML, just set the attribute Stroke="Blue"
If you're creating your series dynamically, add a property MySeriesStroke and bind it to your series

Private _mySeriesStroke As Brush
Public Property MySeriesStroke As Brush
    Get
        Return _mySeriesStroke
    End Get
    Set(ByVal value As Brush)
        If _mySeriesStroke IsNot value Then
            _mySeriesStroke = value
            raisePropertyChangeEvent("MySeriesStroke")
        End If
    End Set
End Property
...
Sub AddSeries()
    ...
   MySeries.SetBinding(LineSeries.StrokeProperty, "MySeriesStroke")
    ...
End Sub
...
Sub ChangeStroke(ByRef brush As Brush)
    MySeriesStroke = brush
End Sub

If you post your code, I can answer more to your op.

owns
  • 305
  • 2
  • 7