Sign in to follow this  

How to implement widgets in in C#....Help please

Recommended Posts

I am trying to use a mixture of fusioncharts and widgets on the same page.  I like to add the charts (column, bar, pie ect.) in the code-behind using data readers and strings...this is working great for the charts.  But now I'm trying to use a similar method to implement some widgets, more specifically, an angular gauge. The code below appears to function just fine, but for some reason I keep getting a javascript error in I.E. (the annoying little error icon that appears on the bottom left corner of the browser).

The error says "Error: Expected ')' Code: 0...Line 1 Character 49"

I'm not sure what is causing the error, the gauge appears to function properly but the error is annoying. Here is the code that brings up the gauge in my code-behind...

private void MedianGauge()


string strSQL7 = "SELECT COUNT(*) AS [MEDHITS] FROM Combined_History WHERE EXACT = 589 AND EXACTSKIP <=693";

DbConn oRs7 = new DbConn(strSQL7);

//xmlData1 will be used to store the entire XML document generated by StringBuilder

StringBuilder xmlData1 = new StringBuilder();

//Generate the chart element

xmlData1.Append("<chart lowerLimit='0' upperLimit='100' lowerLimitDisplay='OVER' upperLimitDisplay='UNDER' gaugeStartAngle='180' gaugeEndAngle='0' palette='1' numberSuffix='%25' tickValueDistance='20' showValue='1'>");


xmlData1.Append("<color minValue='0' maxValue='50' code='FF654F'/>");

xmlData1.Append("<color minValue='50' maxValue='90' code='F6BD0F'/>");

xmlData1.Append("<color minValue='90' maxValue='100' code='8BBA00'/>");





xmlData1.AppendFormat("<dial value='{0}' rearExtension='10'/>", oRs7.ReadData["MEDHITS"].ToString());




//outPut will store the HTML of the chart rendered as string

//when an ajax call is made we use RenderChartHTML method

string outPut7 = "";

outPut7 =

FusionCharts.RenderChartHTML("../../FusionCharts/AngularGauge.swf", "", xmlData1.ToString(), "MedianHitGauge", "330", "200", false, false);

//Clear panel which will contain the chart


//Add Litaral control to Panel which adds the chart from outPut string

Panel6.Controls.Add(new LiteralControl(outPut7));

Ive tried changing many things to see if I could get rid of the error. Nothing has worked and I can't pinpoint it. Is there something wrong with rendering the gauge using... FusionCharts.RenderChartHTML("../../FusionCharts/AngularGauge.swf", "", xmlData1.ToString(), "MedianHitGauge", "330", "200", false, false);

If someone could point me in the right direction I would greatly appreciate it. Or, if there is a better way to render the chart from the code-behind, please show an example.

Edited by Guest

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this