Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9039271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:41:25+00:00 2026-06-16T09:41:25+00:00

I have multiple charts in one page but I am getting this error when

  • 0

I have multiple charts in one page but I am getting this error when I run it:

 Chart Id is same as a JavaScript variable name. Variable naming error. Please use unique name for chart JS variable, chart-id and container id.

If I keep only one chart then it is happy. How can I fix this? here is my code:

public string CreateChart()
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
        string sqlStatement = "SELECT Category, AvgNumbers FROM MyTable";
        SqlCommand cmd = new SqlCommand(sqlStatement, con);
        con.Open();
        SqlDataReader reader = cmd.ExecuteReader();
        string strXML;
        strXML = "<graph caption='Summary' subCaption='By Category' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>";
        while (reader.Read())
        {
            strXML += "<set name='" + reader["Category"].ToString() + "' value='" + reader["AvgNumbers"].ToString() + "' />";
        }
        strXML += "</graph>";
       return FusionCharts.RenderChart("/FusionCharts/Pie3D.swf", "ChartID", strXML, "FactorySum", "650", "450", false, false);

    }

    protected string CreateChart_2()
    {


        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
        string sqlStatement = "SELECT count (ID)as ID, cat_name FROM MainTable group by cat_name";
        SqlCommand cmd = new SqlCommand(sqlStatement, con);
        con.Open();
        SqlDataReader reader = cmd.ExecuteReader();
        string strXML1;
        strXML1 = "<graph caption='Summary' subCaption='By Cat' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>";
        while (reader.Read())
        {
            strXML1 += "<set name='" + reader["cat_name"].ToString() + "' value='" + reader["ID"].ToString() + "' />";
        }
        strXML1 += "</graph>";
        return FusionCharts.RenderChart("/FusionCharts/Pie3D.swf", "MyChartID", strXML1, "FactorySum", "650", "450", false, false);
    }

ASPX code:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
   <div>
       <% =CreateChart() %>
   </div>
   <div>
       <% =CreateChart_2() %>
   </div>
</asp:Content>

I have tried everything but no solution found so far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:41:26+00:00Added an answer on June 16, 2026 at 9:41 am

    I believe in your case 4th parameter in FusionCharts.RenderChart is a Chart ID and not the 2nd one. Try to vary it, e.g. “FactorySum1” and “FactorySum2” and the error should disappear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A Report can have multiple charts. The Chart table looks as follows: Chart --
I am trying to display multiple chart's on one screen but i am not
I have a chart control that works normally for all but one case. If
I am displaying multiple charts in a single page. I have enabled the zoom
I have a chart with multiple Series. I am using the ChartColorPalette to set
I have multiple ajax requests with javascript code as response, and I need to
I have multiple UpdatePanels on a webpage, one inside UserControl (Purple ColorBox as show
I have multiple forms for lots of products on my page and want to
I have multiple input fields on my page. I Regex them with a css
I have multiple input text fields grouped in divs: <div class=container0> <input class=containerItem0 name=containerItem[0][0]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.