offset series

2 posts, 0 answers
  1. Paul Lewis
    Paul Lewis avatar
    31 posts
    Member since:
    Jan 2010

    Posted 16 May 2011 Link to this post

    Hi is there a way to do offset series like the attached picture?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 18 May 2011 Link to this post

    Hi Paul Lewis,

    You can achieve the desired effect by setting the ChartArea.ItemOverlapPercent property to 50:
    var series = new DataSeries();
    series.Definition = new BarSeriesDefinition() { ShowItemLabels = false };
    series.Add(new DataPoint(10));
    series.Add(new DataPoint(20));
    series.Add(new DataPoint(30));
    series.Add(new DataPoint(40));
     
    var series2 = new DataSeries();
    series2.Definition = new BarSeriesDefinition() { ShowItemLabels = false };
    series2.Add(new DataPoint(2));
    series2.Add(new DataPoint(5));
    series2.Add(new DataPoint(10));
    series2.Add(new DataPoint(20));
     
    RadChart1.DefaultView.ChartArea.ItemOverlapPercent = 50;
    RadChart1.DefaultView.ChartArea.DataSeries.Add(series);
    RadChart1.DefaultView.ChartArea.DataSeries.Add(series2);

    Hope this helps.


    Greetings,
    Giuseppe
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top