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

Question about how to set yaxis2

8 Answers 129 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
AUK
Top achievements
Rank 1
AUK asked on 07 Jul 2010, 10:57 AM
Dear experts,

I need to create a chart like the following sample:
http://demos.telerik.com/aspnet-ajax/chart/examples/functionality/yaxis2/defaultcs.aspx


, however in above sample, yaxis2's scale(0-50) is different from the left yaxis(0-5), how to make them to be the same scale as each other?


Thanks very much for your help!

8 Answers, 1 is accepted

Sort by
0
AUK
Top achievements
Rank 1
answered on 09 Jul 2010, 05:23 AM
I used following code but it did not work:

RadChart1.PlotArea.YAxis.MinValue = 0
RadChart1.PlotArea.YAxis2.MinValue = 0
If (RadChart1.PlotArea.YAxis.MaxValue > RadChart1.PlotArea.YAxis2.MaxValue) Then
    RadChart1.PlotArea.YAxis2.MaxValue = RadChart1.PlotArea.YAxis.MaxValue
Else
    RadChart1.PlotArea.YAxis.MaxValue = RadChart1.PlotArea.YAxis2.MaxValue
End If
0
Giuseppe
Telerik team
answered on 09 Jul 2010, 11:49 AM
Hello AUK,

You need to set the AutoScale property of the respective axis to false if you would like to specify manual range for it.

Hope this helps.


Kind regards,
Freddie
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
0
AUK
Top achievements
Rank 1
answered on 20 Jul 2010, 05:53 PM
Hi Telerik,

Sorry about my late reply, I am having another problem here:

After I set the 'AutoScale' property to false then I do be able to set the sacle of yaxis2, however I couldn't get the right maximum value from yaxis, my code is:
RadChart1.PlotArea.YAxis2.AutoScale = False
 RadChart1.PlotArea.YAxis.AxisMode = ChartYAxisMode.Extended
 RadChart1.PlotArea.YAxis2.AxisMode = ChartYAxisMode.Extended
 RadChart1.PlotArea.YAxis2.MinValue = RadChart1.PlotArea.YAxis.MinValue
 RadChart1.PlotArea.YAxis2.MaxValue = RadChart1.PlotArea.YAxis.MaxValue


But the yaxis's scale is different from the yaxis2, I have attached the chart image for your reference.

Thanks for your help!
0
Giuseppe
Telerik team
answered on 22 Jul 2010, 02:51 PM
Hello AUK,

Sorry for misleading you a bit with our previous reply -- unfortunately it is not possible to get the actual range values for the YAxis at the moment when you can set the range values for the YAxis2 (i.e. Page_Load). You will need to disable the AutoScale for the primary YAxis as well and manually set the ranges for both axes if you would like to make them the same.


Regards,
Freddie
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
0
AUK
Top achievements
Rank 1
answered on 25 Jul 2010, 02:05 PM
Hello Telerik,

Now I understand I need to manually calculated the max value for YAxis/YAxis2, after I done that I got another issue was that all the marks along the YAxis/YAxis2 were not readable and there is no horizontal grid line, please see the attached image.

Thanks for your help
0
Velin
Telerik team
answered on 28 Jul 2010, 09:58 AM
Hello AUK,

Unfortunately, it seems that the image you have attached is lost. Please, try to reattach it. Thanks.

All the best,
Velin
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
0
Fernando
Top achievements
Rank 1
answered on 09 Sep 2010, 04:36 PM
How to know the total of each column in the bar chart graph type = "Telerik.Charting.ChartSeriesType.StackedBar" ?
0
Velin
Telerik team
answered on 15 Sep 2010, 08:08 AM
Hi Fernando,

Here is how you can determine the total of each stacked column:
    <telerik:RadChart ID="RadChart1" runat="server"/>
 
protected void Page_Load(object sender, EventArgs e)
{
    RadChart1.PlotArea.XAxis.AxisLabel.Visible = true;
 
    ChartSeries s1 = new ChartSeries("1", ChartSeriesType.StackedBar);
    s1.Appearance.Border.Color = Color.Transparent;
    s1.DataYColumn = "Y";
 
    ChartSeries s2 = new ChartSeries("2", ChartSeriesType.StackedBar);
    s2.Appearance.Border.Color = Color.Transparent;
    s2.DataYColumn = "Y2";
    s2.DefaultLabelValue = "#STSUM";
    RadChart1.Series.Add(s1);
    RadChart1.Series.Add(s2);
 
    RadChart1.DataSource = A.Fill();
    RadChart1.DataBind();
}


Best wishes,
Ryan
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
Tags
Chart (Obsolete)
Asked by
AUK
Top achievements
Rank 1
Answers by
AUK
Top achievements
Rank 1
Giuseppe
Telerik team
Velin
Telerik team
Fernando
Top achievements
Rank 1
Share this question
or