2 dimension Line graph

Thread is closed for posting
4 posts, 0 answers
  1. Kelvin
    Kelvin avatar
    14 posts
    Member since:
    Oct 2007

    Posted 16 Jul 2008 Link to this post

    Hi,

    Does anyone know how to populate the line graph with 2 inputs. I'm able to populate the line chart successfully with one input, it appears on Y-axis, but the X-axis shows the counter of the input. For example, if I have value 10,20,30,40. I can see these 4 values appear on the Y-axis but on X-axis shows 1,2,3,4.

    What I intend to achieve is to have 2 sets of input. Do anyone has example on this ? or is it possible to do it with RadChart using Line.

    Thanks.
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 16 Jul 2008 Link to this post

    Hi Kelvin,

    You can specify the XAxis values for chart series items like this:

    <telerik:RadChart ID="RadChart1" runat="Server"
        <Series> 
            <telerik:ChartSeries Name="Series 1"
                <Items> 
                    <telerik:ChartSeriesItem Name="Item 1" YValue="15" XValue="12"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 2" YValue="10" XValue="20"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 3" YValue="25" XValue="5"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 4" YValue="50" XValue="10"
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
        </Series> 
    </telerik:RadChart> 



    Best wishes,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Kelvin
    Kelvin avatar
    14 posts
    Member since:
    Oct 2007

    Posted 17 Jul 2008 Link to this post

    Hi,

    I managed to display value in X-axis. The intension is to display 24 hours in x-axis. For example, 01:00 02:00 .... 23:00

    However, the label does not show 01:00 02:00 .... 23:00, instead it shows some other value on the x-axis.

    Does anyone try to display HH:MM before ?

    Thanks.
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 17 Jul 2008 Link to this post

    Hello Kelvin,

    You can review this online example here that demonstrates how you can display DataTime data on the numerical axis of RadChart -- the key is to pass the data via the DataTime.ToOADate(...) method as the chart control works only with numeric data.

    Hope this helps.


    All the best,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top