Stacked Area - extending all the way to the left

Thread is closed for posting
7 posts, 0 answers
  1. Dan
    Dan avatar
    13 posts
    Member since:
    Nov 2009

    Posted 17 Aug 2011 Link to this post

    Hello,

    I am using Stacked Area to make a shaded background for certain Y-values. The issue I'm having is I want the Stacked Area to extend all the way to the left. Currently it starts at the same place the first chart value starts.

    I have attached a screenshot where the stacked area is the green section but as you can see it extends all the way to the right but not the left. Note: the gray line does extend the full width of the graph but I also set an X value that is less than any of the displayed X values. I tried something similar with the Stacked Area but could not get it to work.

    Thanks for any help.
  2. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 19 Aug 2011 Link to this post

    Hello Dan,

    You should set the AxisX.LayoutMode property to Normal to achieve this. You can find more information about it in our help topic

    Regards,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dan
    Dan avatar
    13 posts
    Member since:
    Nov 2009

    Posted 19 Aug 2011 Link to this post

    Thank you. That solved it.
  5. Dan
    Dan avatar
    13 posts
    Member since:
    Nov 2009

    Posted 16 Sep 2011 Link to this post

    This does solve the StackedArea but using the "Normal" layout on charts it sometimes causes the bars on bar graphs to be cut off.

    Is there a way to use "Between" AxisMode for the bar graph and "Normal" AxisMode for the StackedArea? These both occupy the same RadChart.
  6. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 19 Sep 2011 Link to this post

    Hi Dan,

    You can set whatever value you want for the LayoutMode of the AxisX but note that all the series in the ChartArea will be drawn according to it. That means that both StackedArea and Bars will have one and the same starting point. What I suggest is that you extend the StackedArea's start date so that it starts earlier than the Bar.

    Greetings,
    Evgenia
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
  7. Dan
    Dan avatar
    13 posts
    Member since:
    Nov 2009

    Posted 19 Sep 2011 Link to this post

    I think I have tried to do that unless you are suggesting doing it some other way. Using the code below it never starts before the first bar graph (for Between LayoutMode setting for XAxis) but does extend all the way past the last X-Value. Basically the screen shot in my first post.

    I have:

    double start = 3.0;
    double increase = 1.0;
      
    ChartSeriesItem chartSeriesItem = new ChartSeriesItem();
    chartSeriesItem.YValue = start;
    chartSeriesItem.XValue = (new DateTime(1900, 1, 1)).ToOADate();
    chartSeriesItem.XValue2 = (new DateTime(2020, 1, 1)).ToOADate();
    ctrlChart.Chart.Series[0].AddItem(chartSeriesItem);
    chartSeriesItem = new ChartSeriesItem();
    chartSeriesItem.YValue = increase;
    chartSeriesItem.XValue = (new DateTime(1900, 1, 1)).ToOADate();
    chartSeriesItem.XValue2 = (new DateTime(2020, 1, 1)).ToOADate();
    ctrlChart.Chart.Series[1].AddItem(chartSeriesItem);
  8. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 21 Sep 2011 Link to this post

    Hi Dan,

    To be able to set manual range for the Axis you should turn off the AutoScale property and provide your own MinValue, MaxVAlue and Step.

    Best wishes,
    Evgenia
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017