views:

18

answers:

0

I have a LineSeries that I am trying to build from the code rather than the XAML.

I am using a LineSeries, but I want to remove the markers, and just have the line. To do this, I've changed the style so that the hight and width are zero:

//modify series style
var lineStyle = new Style(typeof(DataPoint),bChart.Style);
lineStyle.Setters.Add(new Setter(DataPoint.HeightProperty, 0.0));
lineStyle.Setters.Add(new Setter(DataPoint.WidthProperty, 0.0));

// Add series to chart
var a = new LineSeries();
a.IndependentValueBinding = new System.Windows.Data.Binding("Key");
a.DependentValueBinding = new System.Windows.Data.Binding("Value");
a.DataPointStyle = lineStyle;

This works, however the colours change from the original style - they are both now yellow/orange. I would prefer they weren't! Am I better off implementing new colours, or can I modify the default style, rather than imposing a new one?