RadHTMLChart not displaying data

3 posts, 0 answers
  1. jk
    jk avatar
    7 posts
    Member since:
    Feb 2010

    Posted 31 Dec 2014 Link to this post

    In case this helps someone else: I was having difficulty with my column RadHTMLChart. There were no exceptions but it wouldn't display the data. I was binding to a dataview and setting the DataFieldY and DataLabelsField to columns in that dataview. Long story short, it seems that there are certain reserved words that the chart has trouble with. In my case, my dataview had a column named "count" and a column named "Category". I changed my SQL query to give the column names the aliases of "ErrCount" and "CategoryName", changed the chart's DataFieldY and DataLabelsField properties to use these new column names, and then the chart displayed correctly.

    While I have solved my problem, I'm wondering if there is documentation which lists reserved keywords so I don't run into this again?
  2. Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 05 Jan 2015 Link to this post


    I am not able to reproduce the mentioned issue with the code below:
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="600" Height="400">
                <telerik:ColumnSeries DataFieldY="count">
            <XAxis DataLabelsField="Category"></XAxis>
    protected void Page_Load(object sender, EventArgs e)
        RadHtmlChart1.DataSource = GetData();
    protected DataTable GetData()
        DataTable tbl = new DataTable();
        tbl.Columns.Add(new DataColumn("count", typeof(decimal)));
        tbl.Columns.Add(new DataColumn("Category", typeof(string)));
        tbl.Rows.Add(new object[] { 100, "First" });
        tbl.Rows.Add(new object[] { 200, "Second" });
        return tbl;

    Can you please try to reproduce the problem with this example and then tell me what changes you have made, so that I can proceed further with the investigation? Can you also tell us which version of Telerik UI you are using?

    Danail Vasilev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Telerik UI for ASP.NET Core is out
  4. Pratik
    Pratik avatar
    5 posts
    Member since:
    May 2016

    Posted 30 Jun Link to this post

    I am facing same issue with the RadHTMLChart... I'm creating html chart dynamically from code behind.(Below attached). Code not showing any error but chart is not visible on web page



    <telerik:RadHtmlChart ID="h1" runat="server" InvokeLoadData="AfterPageLoad" Width="100%"  CssClass="rdchart"
               Skin="Vista" Visible="true">
                   <Appearance Position="Top" Orientation="Horizontal" Visible="true">
               <ChartTitle Text="POs raised in running 12 months">
                       <TextStyle FontFamily="Tahoma" FontSize="11pt" Bold="true" />
               <Zoom Enabled="true">
                   <MouseWheel Enabled="true" />



    if (ds.Tables.Count>0)
                DataTable dt = new DataTable();
                dt = ds.Tables[0];
                   AxisY axisY = new AxisY();
                    axisY.Name = "POCOUNT";
                    axisY.NarrowRange = false;
                    axisY.TitleAppearance.Text = "PO Count";
                    axisY.TitleAppearance.TextStyle.FontSize = 14;
                    axisY.TitleAppearance.TextStyle.FontFamily = "Tahoma";
                for (int i = 0; i < dt.Rows.Count; i++)
                    ColumnSeries col = new ColumnSeries
                        Name = dt.Rows[i][0].ToString()
                    int j = 1;
                    CategorySeriesItem cs = new CategorySeriesItem();
                    if (iWaveLibrary.ConvertToDecimal(dt.Rows[i][j].ToString())  > 0)
                        cs.Y = iWaveLibrary.ConvertToDecimal(dt.Rows[i][j].ToString());
                    LineSeries ls = new LineSeries();
                    CategorySeriesItem csls = new CategorySeriesItem();
                    if (iWaveLibrary.ConvertToDecimal(dt.Rows[i][2].ToString()) > 0)
                        csls.Y = iWaveLibrary.ConvertToDecimal(dt.Rows[i][2].ToString());
                    ls.AxisName = "POCOUNT";
                    ls.TooltipsAppearance.DataFormatString = "{0}";
                for (int i = 0; i < dt.Rows.Count; i++)
                    AxisItem xAxisItem = new AxisItem(dt.Rows[i][0].ToString());
                    if (!h1.PlotArea.XAxis.Items.Contains(xAxisItem))
                h1.PlotArea.XAxis.AxisCrossingPoints.Add(dt.Rows.Count + 1);
                h1.PlotArea.YAxis.LabelsAppearance.DataFormatString = "N";
                h1.PlotArea.CommonTooltipsAppearance.DataFormatString = "N";
                h1.Visible = true;
                h1.InvokeLoadData = Telerik.Web.UI.HtmlChart.LoadDataInvocation.OnPageLoad;
                h1.PlotArea.YAxis.MinorGridLines.Visible = false;
                h1.PlotArea.XAxis.MinorGridLines.Visible = false;
                h1.PlotArea.XAxis.MajorGridLines.Visible = false;

Back to Top