Sign in to follow this  
pdaniel

Fusioncharts._Fallbackjschartwhennoflash() Not Working As Expected

Recommended Posts

We are trying to implement the FusionCharts._fallbackJSChartWhenNoFlash(); function to run javascript charts within any browser when flash is not available with version 3.2. We wrapped the FusionCharts.cs file to build our own assembly to stick into the GAC. So, I thought I would add the fallbackJSChartWhenNoFlash call inside the below function just above the call to instantiate the new chart ( new FusionCharts...). I have the highcharts.js and your jquery.min.js files inside the same directory as the FusionCharts.js file. In our case they are in a subdirectory off the main application root. I removed flash from my laptop to test. I cleared my cache, history, etc. from the browser. When I run the code, I get the image in place of the charts that states I'm missing a plugin. I read on another post to try to change the reference of the loadScript(baseURL+'highcharts.js') inside the FusionCharts.js file since my .js is in a subdirectory, but that did not work either. Any suggestions would be appreciated! Thanks. Patrick

 

private static string RenderChartALL(string chartSWF, string dataUrl, string dataStr, string chartId, string chartWidth, string chartHeight, bool debugMode, bool registerWithJS, bool allowTransparent, string bgColor, string scaleMode, string language)

{

__INIT();

 

// string dataprovider_js_code;

SetConfiguration("debugMode", boolToNum(debugMode));

SetConfiguration("registerWithJS", boolToNum(true));

// setup debug mode js parameter

int debugMode_js_param = boolToNum(debugMode);

// setup register with js js parameter

int registerWithJS_js_param = boolToNum(true);

string dataFormat = GetConfiguration("dataFormat");

dataFormat = (dataFormat == "" ? "xml" + (dataStr == "" ? "url" : "") : dataFormat + (dataStr == "" ? "url" : ""));

 

if (GetConfiguration("renderAt") == "") SetConfiguration("renderAt", chartId + "Div");

 

string wmode = GetConfiguration("wMode");

if (wmode.Trim() == "" || wmode == null)

{

wmode = allowTransparent ? "transparent" : "opaque";

}

 

SetConfiguration("swfUrl", chartSWF);

SetConfiguration("dataFormat", dataFormat);

SetConfiguration("id", chartId);

SetConfiguration("width", chartWidth);

SetConfiguration("height", chartHeight);

SetConfiguration("wMode", wmode);

 

string dataSource = (dataStr == "" ? dataUrl : dataStr.Replace("\n\r", ""));

string dataSourceJSON = "\"dataSource\" : " + (dataFormat == "json" ? dataSource : "\"" + dataSource + "\"");

string chartConfigJSON = "{" + fc_encodeJSON(GetConfigurationGroup("params"), false) + "," + dataSourceJSON + "}";

 

StringBuilder builder = new StringBuilder();

builder.AppendFormat("<!-- START Script Block for Chart {0} -->" + Environment.NewLine, chartId);

builder.AppendFormat("<div id='{0}Div' >" + Environment.NewLine, chartId);

builder.Append("Chart." + Environment.NewLine);

builder.Append("</div>" + Environment.NewLine);

builder.Append("<script type=\"text/javascript\">" + Environment.NewLine);

builder.Append("FusionCharts._fallbackJSChartWhenNoFlash();" + Environment.NewLine);

builder.AppendFormat("var chart_{0} = new FusionCharts({1}).render();", chartId, chartConfigJSON);

builder.Append("</script>" + Environment.NewLine);

builder.AppendFormat("<!-- END Script Block for Chart {0} -->" + Environment.NewLine, chartId);

 

// Re-Initializing...

__fc__initialize__();

 

return builder.ToString();

 

 

}

Share this post


Link to post
Share on other sites

Hi Pdaniel,

Thanks for your post.

We are unable to reproduce the issue.

Could you please provide any live link or any sample HTML of your issue.

Share this post


Link to post
Share on other sites

Hi Pdaniel,

Thanks for your post.

We are unable to reproduce the issue.

Could you please provide any live link or any sample HTML of your issue.

 

I just stepped through the FusionCharts.cs file in debug mode and it appears the code above does not get executed (RenderChartALL function). I assume this is why it's not working. Which function should I place the fallbackJSChartWhenNoFlash line of code in order for it to execute before the chart renders? when stepping through the code, the following function gets executed..

 

public static string RenderChartHTML(string chartSWF, string dataUrl, string dataStr, string chartId, string chartWidth, string chartHeight, bool debugMode, bool registerWithJS, bool allowTransparent)

{

return RenderChartHTMLALL(chartSWF, dataUrl, dataStr, chartId, chartWidth, chartHeight, debugMode, registerWithJS, allowTransparent, "", "noScale", "EN");

}

 

which then calls

 

private static string RenderChartHTMLALL(string chartSWF, string dataUrl, string dataStr, string chartId, string chartWidth, string chartHeight, bool debugMode, bool registerWithJS, bool allowTransparent, string bgColor, string scaleMode, string language)

{

__INIT();

 

string wmode = GetConfiguration("wMode");

if (wmode.Trim() == "" || wmode == null)

{

wmode = allowTransparent ? "transparent" : "opaque";

}

 

SetConfiguration("movie", chartSWF);

SetConfiguration("src", chartSWF);

SetConfiguration("dataXML", dataStr);

SetConfiguration("dataURL", dataUrl);

SetConfiguration("width", chartWidth);

SetConfiguration("height", chartHeight);

SetConfiguration("chartWidth", chartWidth);

SetConfiguration("chartHeight", chartHeight);

SetConfiguration("DOMId", chartId);

SetConfiguration("id", chartId);

SetConfiguration("debugMode", boolToNum(debugMode));

SetConfiguration("wMode", wmode);

 

string strFlashVars = FC_Transform(GetConfigurationGroup("fvars"), "&{key}={value}", true);

SetConfiguration("flashvars", strFlashVars);

 

string strObjectNode = "<object " + FC_Transform(GetConfigurationGroup("object"), " {key}=\"{value}\"", true) + " >\n";

string strObjectParamsNode = FC_Transform(GetConfigurationGroup("objparams"), "\t<param name=\"{key}\" value=\"{value}\">\n", true);

string strEmbedNode = "<embed " + FC_Transform(GetConfigurationGroup("embed"), " {key}=\"{value}\"", true) + " />\n";

 

 

StringBuilder htmlcodes = new StringBuilder();

htmlcodes.AppendFormat("<!-- START Code Block for Chart {0} -->" + Environment.NewLine, chartId);

htmlcodes.Append(strObjectNode + Environment.NewLine);

htmlcodes.Append(strObjectParamsNode + Environment.NewLine);

htmlcodes.Append(strEmbedNode + Environment.NewLine);

htmlcodes.AppendFormat("</object>\n<!-- END Code Block for Chart {0} -->" + Environment.NewLine, chartId);

 

// Re-Initializing...

__fc__initialize__();

 

return htmlcodes.ToString();

}

 

Should I place the fallbackJSChartWhenNoFlash inside one of these functions? thanks.

Share this post


Link to post
Share on other sites

Not sure if this help as well, but when I step through the FusionCharts.cs file function, the following function returns back the variable value below it. As you can see I added in the FusionCharts._fallbackJSChartWhenNoFlash(); javascript code. Does this look correct?

 

private static string RenderChartHTMLALL(string chartSWF, string dataUrl, string dataStr, string chartId, string chartWidth, string chartHeight, bool debugMode, bool registerWithJS, bool allowTransparent, string bgColor, string scaleMode, string language)

{

__INIT();

 

string wmode = GetConfiguration("wMode");

if (wmode.Trim() == "" || wmode == null)

{

wmode = allowTransparent ? "transparent" : "opaque";

}

 

SetConfiguration("movie", chartSWF);

SetConfiguration("src", chartSWF);

SetConfiguration("dataXML", dataStr);

SetConfiguration("dataURL", dataUrl);

SetConfiguration("width", chartWidth);

SetConfiguration("height", chartHeight);

SetConfiguration("chartWidth", chartWidth);

SetConfiguration("chartHeight", chartHeight);

SetConfiguration("DOMId", chartId);

SetConfiguration("id", chartId);

SetConfiguration("debugMode", boolToNum(debugMode));

SetConfiguration("wMode", wmode);

 

string strFlashVars = FC_Transform(GetConfigurationGroup("fvars"), "&{key}={value}", true);

SetConfiguration("flashvars", strFlashVars);

 

string strObjectNode = "<object " + FC_Transform(GetConfigurationGroup("object"), " {key}=\"{value}\"", true) + " >\n";

string strObjectParamsNode = FC_Transform(GetConfigurationGroup("objparams"), "\t<param name=\"{key}\" value=\"{value}\">\n", true);

string strEmbedNode = "<embed " + FC_Transform(GetConfigurationGroup("embed"), " {key}=\"{value}\"", true) + " />\n";

 

 

StringBuilder htmlcodes = new StringBuilder();

htmlcodes.AppendFormat("<!-- START Code Block for Chart {0} -->" + Environment.NewLine, chartId);

htmlcodes.Append("<script type=\"text/javascript\">" + Environment.NewLine);

htmlcodes.Append("FusionCharts._fallbackJSChartWhenNoFlash();" + Environment.NewLine);

htmlcodes.Append("</script>" + Environment.NewLine);

htmlcodes.Append(strObjectNode + Environment.NewLine);

htmlcodes.Append(strObjectParamsNode + Environment.NewLine);

htmlcodes.Append(strEmbedNode + Environment.NewLine);

htmlcodes.AppendFormat("</object>\n<!-- END Code Block for Chart {0} -->" + Environment.NewLine, chartId);

 

// Re-Initializing...

__fc__initialize__();

 

//builder.Append("FusionCharts._fallbackJSChartWhenNoFlash();" + Environment.NewLine);

//string strHTML = "<script type=\"text/javascript\"><!--\n FusionCharts._fallbackJSChartWhenNoFlash();\n// --></script>";

//return (strHTML);

 

return htmlcodes.ToString();

}

 

 

The htmlcodes.ToString(); equals to.....

 

{<!-- START Code Block for Chart AssetCategoryChartControl -->

<script type="text/javascript">

FusionCharts._fallbackJSChartWhenNoFlash();

</script>

<object id="AssetCategoryChartControl" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="175" width="175" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" >

 

<param name="movie" value="/Applications/App360/WebResource.axd?d=roNKrhcPxj01Eas7TpmjUDPIMaM2V_ezJ1Bo2R-D-F7ysNkiGcf-9nEay0EuMV8hG1tZjMv_3QwiKDOZseQeVz8NsXvsOWzE2bCZKZkQvjsl7RaYAxNWVdNEkptOpvyfaeEQXVpfSn9LltHxG5GZyVeOm4ck5fQoOH8366vxWxsiIhNE0&t=634371695920520834">

<param name="FlashVars" value="&registerWithJS=1&chartHeight=175&DOMId=AssetCategoryChartControl&dataXML=%3cchart+showFCMenuItem%3d'0'+plotGradientColor%3d''+captionPadding%3d'0'+chartTopMargin%3d'0'+chartBottomMargin%3d'0'+chartLeftMargin%3d'0'+chartRightMargin%3d'0'+showBorder%3d'0'+scaleMode%3d'exactFit'+bgColor%3d'%23FFFFFF'+formatNumberScale%3d'0'+showLabels%3d'0'+showValues%3d'0'+borderThickness%3d'0'+animation%3d'1'+numVisiblePlot%3d'8'%3e%3cset+label%3d'Muni+Single+State'+value%3d'779238.0416'+color%3d'%235485BC'+tooltext%3d'Muni+Single+State%26lt%3bBR%26gt%3b%24779%2c238.04%26lt%3bBR%26gt%3b80.51%25'%2f%3e%3cset+label%3d'Large-Cap+Value'+value%3d'126091.8695'+color%3d'%23AA8C30'+tooltext%3d'Large-Cap+Value%26lt%3bBR%26gt%3b%24126%2c091.87%26lt%3bBR%26gt%3b13.03%25'%2f%3e%3cset+label%3d'High-Yield+Muni'+value%3d'74267.3932'+color%3d'%235C9384'+tooltext%3d'High-Yield+Muni%26lt%3bBR%26gt%3b%2474%2c267.39%26lt%3bBR%26gt%3b7.67%25'%2f%3e%3cset+label%3d'Large-Cap+Blend'+value%3d'55190.8443'+color%3d'%23981

A37'+tooltext%3d'Large-Cap+Blend%26lt%3bBR%26gt%3b%2455%2c190.84%26lt%3bBR%26gt%3b5.70%25'%2f%3e%3cset+label%3d'World+Allocation'+value%3d'41942.0204'+color%3d'%23FCB319'+tooltext%3d'World+Allocation%26lt%3bBR%26gt%3b%2441%2c942.02%26lt%3bBR%26gt%3b4.33%25'%2f%3e%3cset+label%3d'Small-Cap+Blend'+value%3d'40349.7912'+color%3d'%2386A033'+tooltext%3d'Small-Cap+Blend%26lt%3bBR%26gt%3b%2440%2c349.79%26lt%3bBR%26gt%3b4.17%25'%2f%3e%3cset+label%3d'Sector+Fund'+value%3d'39610'+color%3d'%23614931'+tooltext%3d'Sector+Fund%26lt%3bBR%26gt%3b%2439%2c610.00%26lt%3bBR%26gt%3b4.09%25'%2f%3e%3cset+label%3d'World+Stock'+value%3d'39243.3086'+color%3d'%2300526F'+tooltext%3d'World+Stock%26lt%3bBR%26gt%3b%2439%2c243.31%26lt%3bBR%26gt%3b4.05%25'%2f%3e%3cset+label%3d'Small-Cap+Value'+value%3d'38895.6'+color%3d'%23594266'+tooltext%3d'Small-Cap+Value%26lt%3bBR%26gt%3b%2438%2c895.60%26lt%3bBR%26gt%3b4.02%25'%2f%3e%3cset+label%3d'Real+Estate'+value%3d'36996.5856'+color%3d'%23CB6828'+tooltext%3d'Real+Estate%26lt%3bBR%26gt%3b%2436%2c996.59%

26lt%3bBR%26gt%3b3.82%25'%2f%3e%3cset+label%3d'High-Yield+Bond'+value%3d'34314.9926'+color%3d'%23AAAAAB'+tooltext%3d'High-Yield+Bond%26lt%3bBR%26gt%3b%2434%2c314.99%26lt%3bBR%26gt%3b3.55%25'%2f%3e%3cset+label%3d'Remaining'+value%3d'259107.852'+color%3d'%23A89375'+tooltext%3d'Remaining%26lt%3bBR%26gt%3b%24259%2c107.85%26lt%3bBR%26gt%3b16.55%25'%2f%3e%3cstyles%3e%3cdefinition%3e%3cstyle+name%3d'myHTMLFont'+type%3d'font'+isHTML%3d'1'+%2f%3e%3c%2fdefinition%3e%3capplication%3e%3capply+toObject%3d'TOOLTIP'+styles%3d'myHTMLFont'+%2f%3e%3c%2fapplication%3e%3c%2fstyles%3e%3c%2fchart%3e〈=EN&scaleMode=noScale&chartWidth=175&debugMode=0">

<param name="wMode" value="transparent">

<param name="allowScriptAccess" value="always">

<param name="quality" value="best">

<param name="scaleMode" value="noScale">

 

<embed src="/Applications/App360/WebResource.axd?d=roNKrhcPxj01Eas7TpmjUDPIMaM2V_ezJ1Bo2R-D-F7ysNkiGcf-9nEay0EuMV8hG1tZjMv_3QwiKDOZseQeVz8NsXvsOWzE2bCZKZkQvjsl7RaYAxNWVdNEkptOpvyfaeEQXVpfSn9LltHxG5GZyVeOm4ck5fQoOH8366vxWxsiIhNE0&t=634371695920520834" pluginspage="http://www.macromedia.com/go/getflashplayer" width="175" type="application/x-shockwave-flash" wMode="transparent" id="AssetCategoryChartControl" scaleMode="noScale" quality="best" flashvars="&registerWithJS=1&chartHeight=175&DOMId=AssetCategoryChartControl&dataXML=%3cchart+showFCMenuItem%3d'0'+plotGradientColor%3d''+captionPadding%3d'0'+chartTopMargin%3d'0'+chartBottomMargin%3d'0'+chartLeftMargin%3d'0'+chartRightMargin%3d'0'+showBorder%3d'0'+scaleMode%3d'exactFit'+bgColor%3d'%23FFFFFF'+formatNumberScale%3d'0'+showLabels%3d'0'+showValues%3d'0'+borderThickness%3d'0'+animation%3d'1'+numVisiblePlot%3d'8'%3e%3cset+label%3d'Muni+Single+State'+value%3d'779238.0416'+color%3d'%235485BC'+tooltext%3d'Muni+Single+State%26lt%3bBR%26gt%3b%24779%2c238.04%26lt%3bBR%

26gt%3b80.51%25'%2f%3e%3cset+label%3d'Large-Cap+Value'+value%3d'126091.8695'+color%3d'%23AA8C30'+tooltext%3d'Large-Cap+Value%26lt%3bBR%26gt%3b%24126%2c091.87%26lt%3bBR%26gt%3b13.03%25'%2f%3e%3cset+label%3d'High-Yield+Muni'+value%3d'74267.3932'+color%3d'%235C9384'+tooltext%3d'High-Yield+Muni%26lt%3bBR%26gt%3b%2474%2c267.39%26lt%3bBR%26gt%3b7.67%25'%2f%3e%3cset+label%3d'Large-Cap+Blend'+value%3d'55190.8443'+color%3d'%23981A37'+tooltext%3d'Large-Cap+Blend%26lt%3bBR%26gt%3b%2455%2c190.84%26lt%3bBR%26gt%3b5.70%25'%2f%3e%3cset+label%3d'World+Allocation'+value%3d'41942.0204'+color%3d'%23FCB319'+tooltext%3d'World+Allocation%26lt%3bBR%26gt%3b%2441%2c942.02%26lt%3bBR%26gt%3b4.33%25'%2f%3e%3cset+label%3d'Small-Cap+Blend'+value%3d'40349.7912'+color%3d'%2386A033'+tooltext%3d'Small-Cap+Blend%26lt%3bBR%26gt%3b%2440%2c349.79%26lt%3bBR%26gt%3b4.17%25'%2f%3e%3cset+label%3d'Sector+Fund'+value%3d'39610'+color%3d'%23614931'+tooltext%3d'Sector+Fund%26lt%3bBR%26gt%3b%2439%2c610.00%26lt%3bBR%26gt%3b4.09%25'%2f%3e%3cset+label%3d'World

+Stock'+value%3d'39243.3086'+color%3d'%2300526F'+tooltext%3d'World+Stock%26lt%3bBR%26gt%3b%2439%2c243.31%26lt%3bBR%26gt%3b4.05%25'%2f%3e%3cset+label%3d'Small-Cap+Value'+value%3d'38895.6'+color%3d'%23594266'+tooltext%3d'Small-Cap+Value%26lt%3bBR%26gt%3b%2438%2c895.60%26lt%3bBR%26gt%3b4.02%25'%2f%3e%3cset+label%3d'Real+Estate'+value%3d'36996.5856'+color%3d'%23CB6828'+tooltext%3d'Real+Estate%26lt%3bBR%26gt%3b%2436%2c996.59%26lt%3bBR%26gt%3b3.82%25'%2f%3e%3cset+label%3d'High-Yield+Bond'+value%3d'34314.9926'+color%3d'%23AAAAAB'+tooltext%3d'High-Yield+Bond%26lt%3bBR%26gt%3b%2434%2c314.99%26lt%3bBR%26gt%3b3.55%25'%2f%3e%3cset+label%3d'Remaining'+value%3d'259107.852'+color%3d'%23A89375'+tooltext%3d'Remaining%26lt%3bBR%26gt%3b%24259%2c107.85%26lt%3bBR%26gt%3b16.55%25'%2f%3e%3cstyles%3e%3cdefinition%3e%3cstyle+name%3d'myHTMLFont'+type%3d'font'+isHTML%3d'1'+%2f%3e%3c%2fdefinition%3e%3capplication%3e%3capply+toObject%3d'TOOLTIP'+styles%3d'myHTMLFont'+%2f%3e%3c%2fapplication%3e%3c%2fstyles%3e%3c%2fchart%3e〈=EN&scaleMod

e=noScale&chartWidth=175&debugMode=0" allowScriptAccess="always" height="175" />

 

</object>

<!-- END Code Block for Chart AssetCategoryChartControl -->

}

Capacity: 7002

Length: 6730

MaxCapacity: 2147483647

Share this post


Link to post
Share on other sites

Does RenderChartHTML not handle _Fallbackjschartwhennoflash()? I believe we had called RenderChartHTML versus RenderChartt for a specific reason. I'm afraid by switching it, it could cause other issues. Is that the only way this works?

Share this post


Link to post
Share on other sites

So I tried calling the Renderchart method and I get javascript errors now. I get the following message.. "Microsoft JScript runtime error: There was an error rendering the chart. Enable FusionCharts JS debugMode for more information." .I set the debugmode='1' but I still can't get rid of this message. I'm hesitant to contineu down this RenderChart method with the issues I'm hitting (unless I absolutely have to, to utilize the _Fallbackjschartwhennoflash.

Share this post


Link to post
Share on other sites

Hi Pdaniel,

Thanks for you reply.

"RenderChartHTML " method directly write the embed/object code to add a flash object in a page. so when there has no flash it will so the plugins missing message.

Where as the JavaScript rendering is handled by the FusionCharts JavaScript rendering method, which checks if there has no flash and the users want to render the js chart if there has no flash then it render the chart in JavaScript mode.

But the "RenderChart" method write the JavaScript rendering method in the page which render the chart using JavaScript.

 

To debug the charts in JavaScript you may refer to this link http://www.fusioncharts.com/docs/Debug/JS.html

Share this post


Link to post
Share on other sites

The error I'm getting is as follows:

Info: Chart loaded and initialized.

Initial Width: 175

Initial Height: 175

Scale Mode: noScale

Debug Mode: Yes

Application Message Language: EN

Version: 3.2.1

Chart Type: 2D Pie Chart

Chart Objects:

BACKGROUND

CANVAS

CAPTION

SUBCAPTION

DATALABELS

DATAPLOT

TOOLTIP

LEGEND

 

INFO: Chart registered with external script. DOM Id of chart is AssetClassChartControl

INFO: XML Data provided using dataXML method.

XML Data: %3cchart+showFCMenuItem%3d'0'+plotGradientColor%3d''+captionPadding%3d'0'+chartTopMargin%3d'0'+chartBottomMargin%3d'0'+chartLeftMargin%3d'0'+chartRightMargin%3d'0'+showBorder%3d'0'+scaleMode%3d'exactFit'+numberPrefix%3d'%24'+bgColor%3d'%23FFFFFF'+formatNumberScale%3d'0'+showLabels%3d'0'+showValues%3d'0'+borderThickness%3d'0'+animation%3d'1'+numVisiblePlot%3d'8'%3e%3cset+label%3d'Fixed+Income'+value%3d'936238.150897'+color%3d'%235485BC'+tooltext%3d'Fixed+Income%26lt%3bBR%26gt%3b%24936%2c238.15%26lt%3bBR%26gt%3b96.28%25'%2f%3e%3cset+label%3d'Domestic+Equity'+value%3d'426777.3510413'+color%3d'%23AA8C30'+tooltext%3d'Domestic+Equity%26lt%3bBR%26gt%3b%24426%2c777.35%26lt%3bBR%26gt%3b43.89%25'%2f%3e%3cset+label%3d'International+Equity'+value%3d'134843.8245006'+color%3d'%235C9384'+tooltext%3d'International+Equity%26lt%3bBR%26gt%3b%24134%2c843.82%26lt%3bBR%26gt%3b13.87%25'%2f%3e%3cset+label%3d'Other'+value%3d'32431.8859485'+color%3d'%23981A37'+tooltext%3d'Other%26lt%3bBR%26gt%3b%2432%2c431.89%26lt%3bBR%26gt%3b3.34%25'%2f%3e%3cset+label%3d'Cash+and+Equivalents'+value%3d'-557907.1431868'+color%3d'%23FCB319'+tooltext%3d'Cash+and+Equivalents%26lt%3bBR%26gt%3b(%24557%2c907.14)%26lt%3bBR%26gt%3b-57.38%25'%2f%3e%3cstyles%3e%3cdefinition%3e%3cstyle+name%3d'myHTMLFont'+type%3d'font'+isHTML%3d'1'+%2f%3e%3c%2fdefinition%3e%3capplication%3e%3capply+toObject%3d'TOOLTIP'+styles%3d'myHTMLFont'+%2f%3e%3c%2fapplication%3e%3c%2fstyles%3e%3c%2fchart%3e

No Data to Display: No data was found in the XML data document provided. Possible cases can be:

There isn't any data generated by your system. If your system generates data based on parameters passed to it using dataURL, please make sure dataURL is URL Encoded.

You might be using a Single Series Chart .swf file instead of Multi-series .swf file and providing multi-series data or vice-versa.

 

I pass in the data via an XML string that executes the following function in FusionCharts.cs. This same XML works when calling the RenderChartHTML method. Any thoughts?

 

private static string RenderChartALL(string chartSWF, string dataUrl, string dataStr, string chartId, string chartWidth, string chartHeight, bool debugMode, bool registerWithJS, bool allowTransparent, string bgColor, string scaleMode, string language)

{

__INIT();

 

// string dataprovider_js_code;

SetConfiguration("debugMode", boolToNum(debugMode));

SetConfiguration("registerWithJS", boolToNum(true));

// setup debug mode js parameter

int debugMode_js_param = boolToNum(debugMode);

// setup register with js js parameter

int registerWithJS_js_param = boolToNum(true);

string dataFormat = GetConfiguration("dataFormat");

dataFormat = (dataFormat == "" ? "xml" + (dataStr == "" ? "url" : "") : dataFormat + (dataStr == "" ? "url" : ""));

 

if (GetConfiguration("renderAt") == "") SetConfiguration("renderAt", chartId + "Div");

 

string wmode = GetConfiguration("wMode");

if (wmode.Trim() == "" || wmode == null)

{

wmode = allowTransparent ? "transparent" : "opaque";

}

 

SetConfiguration("swfUrl", chartSWF);

SetConfiguration("dataFormat", dataFormat);

SetConfiguration("id", chartId);

SetConfiguration("width", chartWidth);

SetConfiguration("height", chartHeight);

SetConfiguration("wMode", wmode);

 

string dataSource = (dataStr == "" ? dataUrl : dataStr.Replace("\n\r", ""));

string dataSourceJSON = "\"dataSource\" : " + (dataFormat == "json" ? dataSource : "\"" + dataSource + "\"");

string chartConfigJSON = "{" + fc_encodeJSON(GetConfigurationGroup("params"), false) + "," + dataSourceJSON + "}";

 

StringBuilder builder = new StringBuilder();

builder.AppendFormat("<!-- START Script Block for Chart {0} -->" + Environment.NewLine, chartId);

builder.AppendFormat("<div id='{0}Div' >" + Environment.NewLine, chartId);

builder.Append("Chart." + Environment.NewLine);

builder.Append("</div>" + Environment.NewLine);

builder.Append("<script type=\"text/javascript\">" + Environment.NewLine);

builder.Append("FusionCharts.debugMode.enabled(true);" + Environment.NewLine);

builder.AppendFormat("var chart_{0} = new FusionCharts({1}).render();", chartId, chartConfigJSON);

builder.Append("</script>" + Environment.NewLine);

builder.AppendFormat("<!-- END Script Block for Chart {0} -->" + Environment.NewLine, chartId);

 

// Re-Initializing...

__fc__initialize__();

 

return builder.ToString();

 

 

}

Share this post


Link to post
Share on other sites

Hi,

 

To create Pure JS chart please use this code as shown below:

 

FusionCharts.SetRenderer("javascript");

...

Literal1.Text = FusionCharts.RenderChart("../FusionCharts/Column2D.swf", "Data/Data.xml", "", "chart1", "600", "300", false, true);

 

reference: http://www.fusioncharts.com/docs/CS_BasicExample.html#js

 

 

It seems that there might be some issue with your data. Could you please send us the data that is getting created before you pass it to the chart?

Share this post


Link to post
Share on other sites

I can render the chart no problem with this data if I use the RenderChartHTML function so I can't believe that it is the data. I also only want the chart to render in javascript if no flash is found. I don't want to render in javascript 100% of the time. Is that what your suggestion will do?

Edited by pdaniel

Share this post


Link to post
Share on other sites

Hi,

 

Yes, you are right. The function " _Fallbackjschartwhennoflash()" does not work with RenderChartHTML() method, as of now. We are working on this but unable to commit any timeline on this.

 

Please try using the RenderChart() method to resolve the same.

 

Hope this helps. :)

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