Plotting 2 line graphs in their own scale

Thread is closed for posting
4 posts, 0 answers
  1. wj
    wj avatar
    12 posts
    Member since:
    Sep 2009

    Posted 11 Feb 2010 Link to this post

    Hi,

    I am plotting 2 line graphs in the same chart and I want to remove the y-axis and let the 2 graphs have their own scale and not scaled relatively to each other. Put it simply, the graph would plot as if it doesnt know the other graph exists. I would use the labels to show the values instead.
    For instance, linegraph 1 which is a sloping straight line with y values from 1 to 10 would be exactly the same as linegraph 2 that has y values from 0 to 100.
     May I know how this can be done?
    Thks for any help!

    Regards,
    Wayne
  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 16 Feb 2010 Link to this post

    Hi,

    You can use the Secondary Y axis in RadChart for the second series. At the same time you can hide both YAxis and YAxis2. Here is an example:

    <telerik:RadChart ID="RadChart1" runat="server">
        <Series>
            <telerik:ChartSeries Name="Series 1" Type="Line">
                <Items>
                    <telerik:ChartSeriesItem Name="Item 1" YValue="0">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 2" YValue="1">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 3" YValue="2">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 4" YValue="3">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 5" YValue="4">
                    </telerik:ChartSeriesItem>
                </Items>
            </telerik:ChartSeries>
            <telerik:ChartSeries Name="Series 2" Type="Line" YAxisType="Secondary">
                <Appearance>
                    <LabelAppearance Visible="False">
                    </LabelAppearance>
                </Appearance>
                <Items>
                    <telerik:ChartSeriesItem Name="Item 1" YValue="0">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 2" YValue="10">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 3" YValue="20">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 4" YValue="30">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem Name="Item 5" YValue="40">
                    </telerik:ChartSeriesItem>
                </Items>
            </telerik:ChartSeries>
        </Series>
        <PlotArea>
            <YAxis Visible="False">
            </YAxis>
            <YAxis2 Visible="False">
            </YAxis2>
        </PlotArea>
    </telerik:RadChart>


    Best regards,
    Ves
    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.
  3. wj
    wj avatar
    12 posts
    Member since:
    Sep 2009

    Posted 26 Feb 2010 Link to this post

    Hi,

    Thanks for your reply. The solution can only work for up to 2 line graphs. However, I have about 5 line graphs that I wish to plot.
    Is there anyway to do that? Thanks!

    Regards,
    wj
  4. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 03 Mar 2010 Link to this post

    Hi wj,

    I am afraid RadChart for ASP.NET AJAX supports only two Y axes. You can take a look at RadChart for Silverlight - it does support multiple Y axes, you can find an example here.

    Greetings,
    Ves
    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