Color Selection for Charts

Charts for WPF Forum

Posted 11 years ago by Don Scott
Version: 13.2.0591

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).



Comments (2)

Posted 11 years ago by Don Scott

Nevermind - Got it....



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


In C#

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

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 (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.