Stacked Bar Strict Mode

Thread is closed for posting
3 posts, 0 answers
  1. Jurgen
    Jurgen avatar
    7 posts
    Member since:
    Jan 2009

    Posted 06 Mar 2009 Link to this post

    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. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 09 Mar 2009 Link to this post

    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.
  3. Jurgen
    Jurgen avatar
    7 posts
    Member since:
    Jan 2009

    Posted 10 Mar 2009 Link to this post

    Thanks!

    that solved it!
Back to Top