This is a migrated thread and some comments may be shown as answers.
Line Chart Error
1 Answer 23 Views
This is a migrated thread and some comments may be shown as answers.
Cliff Gibson
Top achievements
Rank 1
Cliff Gibson asked on 14 Nov 2012, 10:20 AM


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;

chartPriceCorridor1.DataBind();




<telerik:RadHtmlChart ID="chartPriceCorridor1" runat="server" Width="600px" Height="400px" Skin="Metro">
        <ChartTitle Text="Price Corridor" >
            <Appearance Align="Left" />
        </ChartTitle>
        <Legend>
            <Appearance Position="Bottom" />
        </Legend>
        <PlotArea>
            <Series>
                <telerik:LineSeries AxisName="Country" Name="Product" DataFieldY="Price"></telerik:LineSeries>
            </Series>
        </PlotArea>
    </telerik:RadHtmlChart>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 15 Nov 2012, 02:53 PM

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: http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/database/defaultcs.aspx. 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.



Greetings,
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.
Asked by
Cliff Gibson
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or