Shop
Anmelden
MindFusion

Q: I want to create a scatter chart but I don’t know how to make it scatter only. I manage to set the scatters but the line remains. Can I make all the scatters in different color?

A: If you want to show just scatters on your line chart you must set the LineType property of your LineSeries to "None":

 series.LineType = LineType.None;


You can easily make all scatters to be a different color. Just add the brushes that you want to be used for the fill of the scatters and the brushes you want to use as strokes for the scatters to the ScatterFills and ScatterStrokes properties. The control will draw each subsequent scatter with the next brush in the list. Similarly, if you want your scatters to be drawn with the same brush you should have only this brush in the ScatterFills property.
 series.ScatterFills.Add(new SolidColorBrush(Colors.Green));
 series.ScatterFills.Add(new SolidColorBrush(Colors.Blue));
 series.ScatterFills.Add(new SolidColorBrush(Colors.Yellow));

 series.ScatterStrokes.Add(new SolidColorBrush(Colors.Red));
 series.ScatterStrokes.Add(new SolidColorBrush(Colors.Green));
 series.ScatterStrokes.Add(new SolidColorBrush(Colors.Blue));
 series.ScatterStrokes.Add(new SolidColorBrush(Colors.Yellow));

In this example, if you have more than 4 scatters the control will start to re-use the brushes to paint them.

Copyright © 2001-2024 MindFusion LLC. Alle Rechte vorbehalten.
Nutzungsbedingungen - Kontakt