Bound Chart not showing.

4 posts, 0 answers
  1. Eric
    Eric avatar
    2 posts
    Member since:
    Jul 2013

    Posted 13 May 2014 Link to this post

    This is my first time using HtmlChart and I need a bit of help.

    I have bound a grid and chart on the server side. The grid works but the chart doesn't.

    Here is the code and attached is a screen capture what I currently getting and what I would like to see.

    ASP.NET
                            <td width="100%" valign="top" align="left">
                                <telerik:RadHtmlChart ID="barChart" runat="server" Width="600px" Height="200px">
                                </telerik:RadHtmlChart>
                            </td>

    C#
                    DataTable dtNetworkCompareResults = dataSet.Tables["NetworkCompareResults"];

                    radgridSearchResults.DataSource = dtNetworkCompareResults;
                    radgridSearchResults.Visible = true;
                    radgridSearchResults.DataBind();

                    barChart.DataSource = dtNetworkCompareResults;

                    this.barChart.PlotArea.Series.Clear();

                    LineSeries networkSeries1 = new LineSeries { DataFieldY = "Total" };
                    this.barChart.PlotArea.Series.Add(networkSeries1);
                    LineSeries networkSeries2 = new LineSeries { DataFieldY = "PSC" };
                    this.barChart.PlotArea.Series.Add(networkSeries2);
                    LineSeries networkSeries3 = new LineSeries { DataFieldY = "Specialist"};
                    this.barChart.PlotArea.Series.Add(networkSeries3);

                    barChart.PlotArea.XAxis.DataLabelsField = "NetworkName";
                    barChart.PlotArea.XAxis.Name = "NetworkName";

                    barChart.Legend.Appearance.Visible = true;
                    barChart.Visible = true;

                    barChart.DataSource = dtNetworkCompareResults;
                    barChart.DataBind();
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 May 2014 in reply to Eric Link to this post

    Hi Eric,

    Please have a look into this online demo for creating a chart Pro-grammatically .

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric
    Eric avatar
    2 posts
    Member since:
    Jul 2013

    Posted 14 May 2014 in reply to Princy Link to this post

    Princy, Thanks for you quick reply. Nevertheless I had already looked at the example you suggested and many others. 

    Can you please point out what might be missing from the code I posted?

    Thanks,

    Eric Bechtinger
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 May 2014 in reply to Eric Link to this post

    Hi Eric,

    Please have a look into this help article which describes how the items of RadHtmlChart can be created using different approaches like Declarative,Data Binding, Programmatic Creation and Declarative & Programmatic Creation.

    Please provide your full code if it doesn't help you.
    Thanks,
    Princy.
Back to Top