multi colored bars(range palette)

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Post Reply
abol810
Posts: 4
Joined: Sat Aug 11, 2018 2:53 pm

multi colored bars(range palette)

Post by abol810 » Sat Aug 11, 2018 2:57 pm

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?

User avatar
ArctionPasi
Posts: 1362
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: multi colored bars(range palette)

Post by ArctionPasi » Mon Aug 13, 2018 3:15 pm

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 :)
LightningChart Support Team, PT

Post Reply