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

Stacked Area - extending all the way to the left

6 Answers 26 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 17 Aug 2011, 02:59 PM
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.

6 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 19 Aug 2011, 03:23 PM
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.

0
Dan
Top achievements
Rank 1
answered on 19 Aug 2011, 03:27 PM
Thank you. That solved it.
0
Dan
Top achievements
Rank 1
answered on 16 Sep 2011, 03:31 PM
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.
0
Evgenia
Telerik team
answered on 19 Sep 2011, 08:02 AM
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
0
Dan
Top achievements
Rank 1
answered on 19 Sep 2011, 01:51 PM

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);
0
Evgenia
Telerik team
answered on 21 Sep 2011, 01:47 PM
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
Tags
Chart (Obsolete)
Asked by
Dan
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Dan
Top achievements
Rank 1
Share this question
or