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

Stacked Bar Strict Mode

2 Answers 83 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Jurgen
Top achievements
Rank 1
Jurgen asked on 06 Mar 2009, 11:29 AM
Hello,

I have a RadChart with stacked bars to compare 2 timeframes to eachother. First I have some measurements of the first timeframe, the second half of the chart are measurements of the second timeframe. I'm having troubles configuring the chart. It seems to me the strict mode isn't working.

The configuration of the chart is as follows:

Chart.PlotArea.XAxis.DataLabelsColumn =

"XValue";

 

Chart.DataGroupColumn =

"YValueDescr";

with my datatable looking like
XValue:  timestamp        
YValue: the value shown on the chart            
YValueDescr: the name of the serie
With this configuration, a new serie for each YValueDescr is made.

XValue                            YValue            YValueDescr
1/1/2009                        20                    serie1                                        //time frame 1 starts
1/1/2009                        15                    serie2
2/1/2009                        25                    serie1
2/1/2009                        10                    serie2        
1/2/2009                        40                    serie3                                        //time frame 2 starts
1/2/2009                        30                    serie4
2/2/2009                        45                    serie3
2/2/2009                        35                    serie4

What i want is a chart as follows

serie2        serie2        serie4        serie4
serie1        serie1        serie3        serie3

If I don't make new series for the second time frame and use serie1 and serie2, they are displayed correctly, but it doesn't show clearly where the new timeframe begins (all the same color).
If I make new series, the XValues and range are displayed correctly, but serie 3 and 4 are displayed stacked above 1 and 2 and the second half of the range of the Xaxis is empty.
I can do this trough the smart tag, but i have to do this manually.

Who can help me out here?

 

2 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 09 Mar 2009, 07:21 AM
Hi Jurgen,

The reason for this behavior is the X axis behavior with DataLabelsColumn set. This property defines the column, which will provide the X axis items labels, but these are only labels and they are not tied with any value. So, when the bars are added their position along the X axis is not configured, so each series starts from the beginning of the axis. You can configure the series so that the ChartSeriesItems have XValue property set -- this will force them to appear at the correct X position. I have attached a small example showing this.

Best regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jurgen
Top achievements
Rank 1
answered on 10 Mar 2009, 09:04 AM
Thanks!

that solved it!
Tags
Chart (Obsolete)
Asked by
Jurgen
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jurgen
Top achievements
Rank 1
Share this question
or