Color Selection for Charts

Charts for WPF Forum

Posted 6 years ago by Don Scott
Version: 13.2.0591
Avatar

How do I define a custom palette for the AreaSeries and LineSeries in an XYChart?  The Palette.Kind values do not provide selection required.  I want to be displaying a gradient (as AreaSeries) for one of the values with a specific color, and then draw two additional lines (as LineSeries) - with specific colors (and line thicknesses as well).

 

Thanks.

Comments (2)

Posted 6 years ago by Don Scott
Avatar

Nevermind - Got it....

 

In XAML

 <charts:SeriesPaletteStyleSelector x:Name="spssMyChart" AreaBrushKind="LightToDarkGradient" />

 

In C#

Color[] myColors = { Colors.Blue, Colors.Red, Colors.Green };
ActiproSoftware.Windows.Controls.Charts.Palettes.
Palette myPalette = new ActiproSoftware.Windows.Controls.Charts.Palettes.Palette(myColors);
spssMyChart.Palette = myPalette;
Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Don,

Check out our XY Chart "Palette Custom Colors" QuickStart.  That shows how to make a style selector with a custom palette.  The sample is for three area series but you could easily swap in a couple line series instead.

Also the SeriesPaletteStyleSelector class has an AreaBrushKind property you can set to apply gradient effects.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.