Does anyone know how to or found any good examples of explicitly setting the color of the data points series when using the WPFToolkit chart control? I would like to set this as a style in my XAML.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
You can set the Palette on the Chart. This example is for a ColumnSeries, but you can adapt it for whatever type you are using.
The Palette definition looks like this:
The "ColumnSeries1Style" and "ColumnSeries1Style" styles define the background brush for the series:
You can define the brushes however you like. Here is how to get the gradient fill used in the default charts:
Just in case anybody is interested, there is a simpler way of doing it. You just need to set the DataPointStyle in the ColumnSeries and change the Background property.