Multiple Charts on one page

2 posts, 0 answers
  1. Cory
    Cory avatar
    20 posts
    Member since:
    Sep 2015

    Posted 16 May Link to this post

    I'm creating a dashboard and have a couple of DIVs defined... chart1, chart2.  I would like to fill them with RadCharts.

    My problem is that when I draw the chart to the page - I only get one of them... the second on overwrites the first one.

    Can you not have more than one radhtmlchart on a page???

    I'm using a datatable from an oracle database to create the data... here is how the code is defined:

    on ASP page:

    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div runat="server" id="Chart1">
    Chart 1
    <div runat="server" id="Chart2">
    Chart 2


    In Code Behind:

    DataTable lPerson = app.GetPersonDashboard();
    RadHtmlChart columnChart = new RadHtmlChart();
    columnChart.ID = "ColumnChart";
    columnChart.ChartTitle.Text = "EED Person Table Yesterday to Today (6 am)";
    columnChart.Width = Unit.Pixel(350);
    columnChart.Height = Unit.Pixel(300);
    columnChart.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;
    //columnChart.PlotArea.XAxis.TitleAppearance.Text = "Record Type";
    //columnChart.PlotArea.YAxis.TitleAppearance.Text = "Records Processed";
    ColumnSeries ProcessedRecords = new ColumnSeries();
    ProcessedRecords.Name = "Processed Records";
    ProcessedRecords.LabelsAppearance.Visible = false;
    ProcessedRecords.TooltipsAppearance.Color = System.Drawing.Color.White;
    ProcessedRecords.TooltipsAppearance.DataFormatString = "{0} Records";
    ColumnSeries ErrorRecords = new ColumnSeries();
    ErrorRecords.Name = "Error Records";
    ErrorRecords.Appearance.FillStyle.BackgroundColor = Color.Violet;
    ErrorRecords.LabelsAppearance.Visible = false;
    ErrorRecords.TooltipsAppearance.Color = System.Drawing.Color.White;
    ErrorRecords.TooltipsAppearance.DataFormatString = "{0} Records";
    foreach (DataRow row in lPerson.Rows)
    decimal RecCount = (decimal)row["record_count"];
    if (row["table_name"].ToString() == "ProcessCount")
    CategorySeriesItem ProcCount = new CategorySeriesItem(RecCount);
    if (row["table_name"].ToString() == "ErrorCount")
    CategorySeriesItem ErrCount = new CategorySeriesItem(RecCount);
    // This is the second chart on the page
    DataTable lEED = app.GetEEDBulkDashboard();
    RadHtmlChart EEDChart = new RadHtmlChart();
    EEDChart.ID = "ColumnChart";
    EEDChart.ChartTitle.Text = "Bulk Email Table Errors";
    EEDChart.Width = Unit.Pixel(350);
    EEDChart.Height = Unit.Pixel(300);
    EEDChart.Legend.Appearance.Position = Telerik.Web.UI.HtmlChart.ChartLegendPosition.Bottom;
    foreach (DataRow row in lEED.Rows)
    ColumnSeries EEDCol = new ColumnSeries();
    EEDCol.Name = row["groupname"].ToString();
    EEDCol.LabelsAppearance.Visible = false;
    EEDCol.TooltipsAppearance.Color = System.Drawing.Color.White;
    EEDCol.TooltipsAppearance.DataFormatString = "{0} Records";
    decimal RecCount = (decimal)row["record_count"];
    CategorySeriesItem RecCountCol = new CategorySeriesItem(RecCount);



    Please help!





  2. Cory
    Cory avatar
    20 posts
    Member since:
    Sep 2015

    Posted 16 May Link to this post

    Ignore this post - it helps if each of them have their own ID!!!  moron.  Oh well.
  3. DevCraft R3 2016 release webinar banner
Back to Top