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

Multiple Y axis

6 Answers 175 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 13 Oct 2011, 12:15 PM
Hello,
    Is it possible to have multiple y axis stacked one on other, (i.e) if i have 4 series have 4 y axis?  The graph would look like 4 Y-axis in the left side since 4 series displayed all the 4 would be having different scaling.
I do not want some thing similar to the "Y Axis Type".

I am using visual studio 2010, Telerik Reporting (licensed -TV446243)

Regards,
Saravanan.R

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Oct 2011, 01:31 PM
Hello Saravanan,

The chart report item does not support such functionality. You can only have a secondary YAxis that is displayed at the right hand side of the chart.

Greetings,
Steve
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Purnachandrarao
Top achievements
Rank 1
answered on 24 Nov 2011, 07:16 AM
Dear Steve,

I am using Reporting with charts, binding the chart datasourse using a data table, after binding i cannot Set the Secondary Y axis



 rpt.Chart1.PlotArea.XAxis.DataLabelsColumn = "X"
            rpt.Chart1.DataSource = RadChartDutiesData()
            rpt.Chart1.Series(0).PlotArea.YAxis.YAxisType = Telerik.Charting.ChartYAxisType.Secondary
            ReportViewer1.Report = rpt


 Private Function RadChartDutiesData() As DataTable
        Dim dt As New DataTable("SampleData")
        Dim dc1 As New DataColumn("X", GetType(String))
        Dim dc2 As New DataColumn("Total Duties paid(RM in Millon)", GetType(String))
        Dim dc3 As New DataColumn("Total Duties Exampted(RM in Millon)", GetType(String))


        dt.Columns.Add(dc1)
        dt.Columns.Add(dc2)
        dt.Columns.Add(dc3)
        Dim col1() As String = {"jan 11", "Feb 11", "march 11", "April 11", "May 11", "June 11", "July 11", "Aug 11", "Sep 11"}
        Dim col2() As String = {"0.44", "0.38", "0.08", "0.28", "0.21", "0.49", "0.12", "0.28", "0.42"}
        Dim col3() As String = {"20.10", "6.83", "13.5", "10.43", "6.64", "11.33", "8.27", "18.28", "9.70"}
        For i As Integer = 0 To col1.Length - 1
            Dim dr As DataRow = dt.NewRow
            dr("x") = col1(i).ToString
            dr("Total Duties paid(RM in Millon)") = col2(i).ToString
            dr("Total Duties Exampted(RM in Millon)") = col3(i).ToString
            dt.Rows.Add(dr)
        Next
        Return dt


    End Function



Can U please Help Me in this
0
Saravanan
Top achievements
Rank 1
answered on 16 Jan 2012, 09:41 AM

Hello Steve,

 Can I have the sample code path from where I can get the help for ploting "ChartPlotArea.YAxis2" manually windows and web.
Is there any new versions that I can update to check for multiple Y axis as shown in the demo below for telerik reporting.
http://demos.telerik.com/silverlight/#Chart/MultipleYAxes

I am using visual studio 2010, Telerik Reporting (licensed -TV446243)

Regards,
Saravanan.R

0
Steve
Telerik team
answered on 16 Jan 2012, 11:10 AM
Hello Saravanan,

We have not added any new functionality to the chart item since you originally asked whether you can have more than two YAxis. There is no documentation for programmatic creation of second YAxis as there is nothing specific i.e. it is created just like the original (first) YAxis. You can manually create the second YAxis from the report designer and check the code it has generated in InitializeComponent for more info. This is the recommended approach whenever you're not sure how to create certain thing programmatically.

Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Saravanan
Top achievements
Rank 1
answered on 16 Jan 2012, 12:49 PM
Hello Steve,

Thanks for the reply. I was actually about to edit the question. Sorry for the inconvenience. My actual question was that when we map the datasource( HistoryChart.DataSource = dtChart; dtChart is datatable) to the chart it automatically takes the x and y axis values. I am having 2 values populated on the primary Y-Axis. How will I populate 1 of the values to Y axis to "Secondary". If it was manual we can set one of the series YAxisType to secondary and the next to primary, so the 2 values can be done on 2 Y-axis. With the code below only values are populated in primary not in secondary. I have attached the image file too.


private

void chart1_NeedDataSource(object sender, EventArgs e)

{

Telerik.Reporting.Charting.ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries();

 Telerik.Reporting.Charting.ChartSeries chartSeries2 = new Telerik.Reporting.Charting.ChartSeries();

 

for (int i = 1; i < 5; i++)

{

Telerik.Reporting.Charting.ChartSeriesItem item1 = new Telerik.Reporting.Charting.ChartSeriesItem();

 item1.YValue = i * 5;

chartSeries1.Items.Add(item1);

}

chartSeries1.Name = "EmpID";

 

chartSeries2.YAxisType = Telerik.Reporting.Charting.ChartYAxisType.Secondary;  

chartSeries2.Name = "StoreID";

  

for (int i = 1; i < 5; i++)

 {

Telerik.Reporting.Charting.ChartSeriesItem item2 = new Telerik.Reporting.Charting.ChartSeriesItem();

 item2.YValue2 = i * 2;

chartSeries2.Items.Add(item2);

}

this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {

 chartSeries1,

chartSeries2});

 //chart1.DataSource = sqlDataSource1;

 }

 


I am using visual studio 2010, Telerik Reporting (licensed -TV446243)

Regards,
Saravanan.R
0
Saravanan
Top achievements
Rank 1
answered on 17 Jan 2012, 11:21 AM
Hello,
    It works as below for secondary y axis.

private

 

 

void chart1_NeedDataSource(object sender, EventArgs e)

 

{

Telerik.Reporting.Charting.

 

ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries();

 

Telerik.Reporting.Charting.

 

ChartSeries chartSeries2 = new Telerik.Reporting.Charting.ChartSeries();

 

 

 

for (int i = 1; i < 5; i++)

 

{

Telerik.Reporting.Charting.

 

ChartSeriesItem item1 = new Telerik.Reporting.Charting.ChartSeriesItem();

 

item1.YValue = i * 5;

chartSeries1.Items.Add(item1);

}

chartSeries1.Name =

 

"EmpID";

 

chartSeries1.YAxisType = Telerik.Reporting.Charting.

 

ChartYAxisType.Secondary;

 

 

 

for (int i = 1; i < 5; i++)

 

{

Telerik.Reporting.Charting.

 

ChartSeriesItem item2 = new Telerik.Reporting.Charting.ChartSeriesItem();

 

item2.YValue = i * 3;

chartSeries2.Items.Add(item2);

}

chartSeries2.Name =

 

"StoreID";

 

chartSeries2.YAxisType = Telerik.Reporting.Charting.

 

ChartYAxisType.Primary;

 

 

 

this.chart1.Series.AddRange(new Telerik.Reporting.Charting.ChartSeries[] {

 

chartSeries1,

chartSeries2});

}

Tags
General Discussions
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Steve
Telerik team
Purnachandrarao
Top achievements
Rank 1
Saravanan
Top achievements
Rank 1
Share this question
or