Line Chart Error

2 posts, 0 answers
  1. Cliff Gibson
    Cliff Gibson avatar
    45 posts
    Member since:
    Oct 2009

    Posted 14 Nov 2012 Link to this post

    I've got the line chart below on my page and am binding this to a dataset on click of a search button once the user has selected their criteria.

    This dataset contains columns Country, Product & Price.  I would like Country displayed along the bottom (x-axis), and then have Price plotted on the graph for each product.

    I believe I've got this defined correctly however when I run the report I get a js error "'t.options' is null or not an object".  Please can you advise on this?

    In the code behind I'm simply retrieving my dataset and then:

    chartPriceCorridor1.DataSource = Prices;


    <telerik:RadHtmlChart ID="chartPriceCorridor1" runat="server" Width="600px" Height="400px" Skin="Metro">
            <ChartTitle Text="Price Corridor" >
                <Appearance Align="Left" />
                <Appearance Position="Bottom" />
                    <telerik:LineSeries AxisName="Country" Name="Product" DataFieldY="Price"></telerik:LineSeries>
  2. Marin Bratanov
    Marin Bratanov avatar
    5706 posts

    Posted 15 Nov 2012 Link to this post

    Hello Cliff,

    The field where the x-axis labels are taken from is in the XAxis tag itself - the DataLabelsField properly. The AxisName property of the series defines which y-axis it will use in case you are using multiple Y-axes.
    You can see it in action here: This demo uses a column series and a database but this is not importanat, you can change the series to LineSeries and where the datasource comes from does not matter.

    Marin Bratanov
    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.
Back to Top