LineSeries/BarSeries colors.

Charts for WPF Forum

Posted 9 years ago by adam
Version: 14.2.0611
Avatar

Hey,

 

I'd like to visualize up to 10 data series on the chart (at the runtime).

My question is about line/bar colors. Each time I add new data serie to the chart, colors of other lines/bars are changing.

Is there a way to preserve colors, or set them manually?

 

Best regards,

Adam Lamarz

Comments (1)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Adam,

By default each series will get a new color.  And by default, when you have more series than the number of colors defined on a palette, additional shades will be auto generated.

The "Palette Custom Colors" QuickStart show show you can customize the palettes.  You can also disable shade generation.  This code shows how to use a single color for all the series:

<charts:XYChart Style="{StaticResource ChartStyle}">
 <charts:XYChart.SeriesStyleSelector>
  <charts:SeriesPaletteStyleSelector>
   <charts:Palette IsShadeGenerationEnabled="False">
    <Color>#BA2A67</Color>
   </charts:Palette>
  </charts:SeriesPaletteStyleSelector>
 </charts:XYChart.SeriesStyleSelector>
...


Actipro Software Support

The latest build of this product (v24.1.1) 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.