BarSeries with only 1 datapoint in each


#1

I want to show 3 BarSeries with only 1 datapoint in each. Each series will have a different Bar color. I have done the code for this and get the graph too. But the Axis Tickmarks aren’t placed at the centre of the Bar. I have x-Axis as NumberAxis & y-Axis as CategoryAxis.

Please suggest a solution for this.


#2

Hi jagritishaigal,

When you use a different series for each point, the chart lays out the bars to leave space for one point in each series at each y-value, which is why the bars aren’t centered on the tickmarks.

The recommended way to customize the color of the bars is to use individual point styling. There’s a full working example on github - you’d just need to subclass SChartBarSeries instead of SChartColumnSeries.

Kind regards,

Alison


#3

I guess I have a very old version of Shinobi so I am not able to use this method provided. Please suggest another solution.


#4

Hi jagritishaigal,

The way we used to recommend doing this was to set the stackIndex on each series to the same value, e.g.

barSeries.stackIndex = @1;

Note that we’ve done a lot of work on shinobicharts in the last 3 years - maybe you could download a free trial and take a look at what’s changed?

Kind regards,

Alison


#5

I have X axis as Numbers with +ve/-ve values. The Chart plotted is attached. I need to add annotations too for each series. Please suggest a fix for this ambiguity I am facing.


#6

Hi,

Are you asking how to add annotations or are you having difficulty with existing annotations that you have added? I’m unclear if your image is a screen shot of a chart, or a proof of concept type image ?

Thanks,

Kai