Page 1 of 1

multi colored bars(range palette)

Posted: Sat Aug 11, 2018 2:57 pm
by abol810
hi there.
i'm trying to create a bar series that has a range palette( like the one in the multicolorlinepalette example) but i'm having difficulty to do so.
bar series has no palette property.
how can i implement this?

Re: multi colored bars(range palette)

Posted: Mon Aug 13, 2018 3:15 pm
by ArctionPasi
The bar series in 2D or 3D don't have palette coloring support directly.

In 3D we have made an example with SurfaceMeshSeries, "ExampleSurfaceMeshBars". Is 3D approach applicable to you?

For 2D, there's several ways to achieve multi-colored bars. E.g.
  • If each bar should be of one color only, Creating a LineCollection for each bar. Set one line in each LineCollection and set line color for the LineCollection.
  • HighLowSeries. Create two data points in each series, to present a rectangle. Left and right edge. High and Low. It supports palette.
  • PolygonSeries. Create a polygon of 4 points for each bar. Set the fill color accordingly.
Please note there's two good helpers available, in converting a value to color.
ValueRangePalette.GetColorByValue method
ChartTools.ConvertDataToColorsByFixedIntervalPalette

I hope this helps :)