This is a migrated thread and some comments may be shown as answers.

RangeBarSeries won't stack

5 Answers 102 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 22 Mar 2016, 06:21 PM

I have a chart with several percentile bands, which I want displayed on top of each other. When I create the RangeBarSeries for each and add them, they appear staggered rather than on top of each other (see attached).

 

I searched the docs and the forum and I found posts for other platforms that suggested setting the CombineMode to None, but that didn't make any difference. I also tried setting the CombineMode to every other possible setting, and also set the StackGroupKey but nothing helped.

 

I had initially just used the bar series with a transparent bar at the bottom to lift everything up to the proper starting height, BUT I have a switch to go between area and bar, and the area seems to have a bug that made the transparency not work. Ironically with the ranges, the bar fails and the area works.

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Mar 2016, 09:48 AM
Hello Steve,

Thank you for writing.

RangeBarSeries allows you to define a range with each data point. It is not relevant to stack the bars as this will change the specific range actually. That is why the recommended approach is to use BarSeries with a transparent BarSeries at the bottom as you have already found out. As to the AreaSeries, feel free to specify a white color for the bottom most series to simulate transparency.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Steve
Top achievements
Rank 1
answered on 24 Mar 2016, 02:41 PM

I do not agree with your answer " is not relevant to stack the bars as this will change the specific range actually". There needs to be a way to have the bars on top of each other. When stacked they should not ADD to each other because they each have their own ranges, but they need to be in line with each other. 

The area series cannot be set to white to hide the first area because it obstructs gridlines,and setting it to transparent doesn't work.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Mar 2016, 10:11 AM
Hello Steve,

Thank you for writing.

When using a RangeBarSeries, the vertical axis displays the different ranges. It is not designed to stack because you can encounter a situation in which two RangeDataPoints overlaps. However, I have logged an issue that RangeSeries shouldn't be clustered in ChartSeriesCombineMode.None

You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to convert the bar ranges data in order to use BarSeries.  Here is demonstrated a sample approach demonstrating how to transform range bars to bars:

RangeBarSeries rangeBarSeries = new RangeBarSeries();
rangeBarSeries.BackColor = Color.Red;
rangeBarSeries.DataPoints.Add(new RangeDataPoint(7, 5, "January"));
rangeBarSeries.DataPoints.Add(new RangeDataPoint(7, 5, "February"));
rangeBarSeries.DataPoints.Add(new RangeDataPoint(7, 5, "March"));
radChartView1.Series.Add(rangeBarSeries);
rangeBarSeries.CombineMode = ChartSeriesCombineMode.Stack;
 
RangeBarSeries rangeBarSeries2 = new RangeBarSeries();
rangeBarSeries2.BackColor = Color.Aqua;
rangeBarSeries2.DataPoints.Add(new RangeDataPoint(8, 7, "January"));
rangeBarSeries2.DataPoints.Add(new RangeDataPoint(8, 7, "February"));
rangeBarSeries2.DataPoints.Add(new RangeDataPoint(8, 7, "March"));
radChartView1.Series.Add(rangeBarSeries2);
rangeBarSeries2.CombineMode = ChartSeriesCombineMode.Stack;

 

BarSeries dummy = new BarSeries();
dummy.DataPoints.Add(new CategoricalDataPoint(5, "January"));
dummy.DataPoints.Add(new CategoricalDataPoint(5, "February"));
dummy.DataPoints.Add(new CategoricalDataPoint(5, "March"));
this.radChartView1.Series.Add(dummy);
dummy.BackColor = Color.Transparent;
dummy.BorderColor = Color.Transparent;
dummy.CombineMode = ChartSeriesCombineMode.Stack;
 
BarSeries barSeries = new BarSeries();
barSeries.DataPoints.Add(new CategoricalDataPoint(2, "January"));
barSeries.DataPoints.Add(new CategoricalDataPoint(2, "February"));
barSeries.DataPoints.Add(new CategoricalDataPoint(2, "March"));
this.radChartView1.Series.Add(barSeries);
barSeries.BackColor = Color.Red;
barSeries.CombineMode = ChartSeriesCombineMode.Stack;
 
BarSeries barSeries2 = new BarSeries();
barSeries2.DataPoints.Add(new CategoricalDataPoint(1, "January"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(1, "February"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(1, "March"));
this.radChartView1.Series.Add(barSeries2);
barSeries2.BackColor = Color.Aqua;
barSeries2.CombineMode = ChartSeriesCombineMode.Stack;

As to the AreaSeries, the transparent color works. However, note that the area underneath the transparent one will be displayed in this case. That is why I suggested o use white color. However, you noted that the RangeSeries are displayed according to your requirement. Feel free to use its for area.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Steve
Top achievements
Rank 1
answered on 25 Mar 2016, 01:54 PM

I do not agree with your answer regarding the stacked areas. The transparency does not "work". The "area underneath the transparent one will be displayed in this case" is WRONG because they are stacked.  There is no area underneath the bottom layer to display. They are each STACKED on top of each other, they should not be layered in front of each other.

 

There is a clear inconsistency between the bars and the area here. Setting the bottom bar to transparent should have the same effect as setting the bottom area to transparent, and that you can't see that inconsistency is a little disturbing to me.

 

As for the range bar, I won't belabor the point since you already agreed you should add a mode for them to not cluster, but again there is an inconstancy between the bars and the areas. Of course they CAN overlap. So what? The areas can overlap too. Just paint one on in front of the other like you would any other series (e.g. lines, scatter) where points overlap.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Mar 2016, 08:56 AM
Hello Steve,

Thank you for writing back. 

I have discussed with our development team the stack functionality in AreaSeries and we have decided to log a feature request to improve the rendering mechanism. You can track its progress, subscribe status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ChartView
Asked by
Steve
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Steve
Top achievements
Rank 1
Share this question
or