smithygreg

No Data To Display In Javascript

Recommended Posts

Hi, I recently started trying to use the javascript HTML5 rendering for my charts and I am not having much luck.

 

I have

FusionCharts.setCurrentRenderer('javascript');

specified in the head of my document.

 

I WAS using the C# RenderChartHTML method to create the charts before with no issues.

When I tried to use that method, it continued to export the <object><embed> tags, so lookin g at the examples, I switched over to the RenderChart method.

 

Now I just get either a blank chart, or one that says "No Data to Display"...

The following is the code that is created from the RenderChart method...Should this successfully create a chart or have i missed something? I am putting my xml in the dataStr parameter. Should I be using the dataXML parameter?

 

Thanks for any help! Excited about taking advantage of this new functionality...

 


<!-- Using ASP.NET FusionCharts v3.2.2.1 Wrapper and JavaScript rendering --><!-- START Script Block for Chart myNext303 -->
<div id='myNext303Div' >
Chart.
</div>
<script type="text/javascript">
if (FusionCharts && FusionCharts("myNext303")) 
FusionCharts("myNext303").dispose();
var chart_myNext303 = new FusionCharts(
	{"dataFormat" : "xml", 
	"scaleMode" : "noScale", 
	"renderAt" : "myNext303Div", 
	"id" : "myNext303", 
	"debugMode" : "0", 
	"lang" : "EN", 
	"swfUrl" : "FusionCharts/Column3D.swf", 
	"wMode" : "opaque", 
	"width" : "500", 
	"height" : "400", 
	"registerWithJS" : "1",
	"dataSource" : 
		"<graph caption='Divisional Accessorial Details' 
				subCaption='Fuel Surcharge - Ground' 
				xAxisName='' yAxisName='' 
				decimalPrecision='0' 
				formatNumberScale='0' 
				showNames='1' 
				numberPrefix='' 
				numberSuffix='' 
				enableSmartLabels ='1' 
				baseFontSize ='9' 
				outCnvBaseFont ='9' 
				showBorder='0' 
				bgColor ='EEEEEE' 
				canvasbgColor='EEEEEE' 
				labelStep='1' 
				showValues='0'  
				labelDisplay='Rotate' 
				slantLabels='1' >
			<styles> 
				<definition> 
					<style name='MyFirstFontStyle' type='font' font='Verdana' size='12' /> 
				</definition> 
				<application> 
					<apply toObject='Caption' styles='MyFirstFontStyle' /> 
				</application>  
			</styles> 
			<set name='Newark-Corp' value='207296' color='1941A5' toolText='207,296.00' link='DashBoard.aspx%3fID%3d45%26DID%3d16%26AID%3d12%27 />
			<set name='Newark-IT' value='202351' color='AFD8F8' toolText='202,351.00' link='DashBoard.aspx%3fID%3d45%26DID%3d17%26AID%3d12%27 />
			<set name='Anaheim-Parcel' value='190401' color='F6BD0F' toolText='190,401.00' link='DashBoard.aspx%3fID%3d45%26DID%3d18%26AID%3d12%27 />
			<set name='Anaheim-Freight' value='212726' color='8BBA00' toolText='212,726.00' link='DashBoard.aspx%3fID%3d45%26DID%3d19%26AID%3d12%27 />
			<set name='Tampa-Samples' value='167985' color='A66EDD' toolText='167,985.00' link='DashBoard.aspx%3fID%3d45%26DID%3d20%26AID%3d12%27 />
			<set name='Tampa-Returns' value='200791' color='F984A1' toolText='200,791.00' link='DashBoard.aspx%3fID%3d45%26DID%3d21%26AID%3d12%27 />
			<set name='Tampa-Corp' value='138377' color='CCCC00' toolText='138,377.00' link='DashBoard.aspx%3fID%3d45%26DID%3d22%26AID%3d12%27 />
			<set name='Tampa-Stores' value='155454' color='999999' toolText='155,454.00' link='DashBoard.aspx%3fID%3d45%26DID%3d23%26AID%3d12%27 />
			<set name='Tampa-Docs' value='196397' color='0099CC' toolText='196,397.00' link='DashBoard.aspx%3fID%3d45%26DID%3d24%26AID%3d12%27 />
			<set name='Lakeland-Corp' value='195165' color='FF0000' toolText='195,165.00' link='DashBoard.aspx%3fID%3d45%26DID%3d25%26AID%3d12%27 />
			<set name='Lakeland-Sales' value='270565' color='006F00' toolText='270,565.00' link='DashBoard.aspx%3fID%3d45%26DID%3d26%26AID%3d12%27 />
			<set name='NY-Madison' value='243340' color='0099FF' toolText='243,340.00' link='DashBoard.aspx%3fID%3d45%26DID%3d27%26AID%3d12%27 />
			<set name='NY-Sales' value='229336' color='FF66CC' toolText='229,336.00' link='DashBoard.aspx%3fID%3d45%26DID%3d28%26AID%3d12%27 />
			<set name='Princeton' value='189082' color='669966' toolText='189,082.00' link='DashBoard.aspx%3fID%3d45%26DID%3d29%26AID%3d12%27 />
		</graph>"
	}).render();
</script>
<!-- END Script Block for Chart myNext303 -->

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi, I recently started trying to use the javascript HTML5 rendering for my charts and I am not having much luck.

 

I have

FusionCharts.setCurrentRenderer('javascript');

specified in the head of my document.

 

I WAS using the C# RenderChartHTML method to create the charts before with no issues.

When I tried to use that method, it continued to export the <object><embed> tags, so lookin g at the examples, I switched over to the RenderChart method.

 

Now I just get either a blank chart, or one that says "No Data to Display"...

The following is the code that is created from the RenderChart method...Should this successfully create a chart or have i missed something? I am putting my xml in the dataStr parameter. Should I be using the dataXML parameter?

 

Thanks for any help! Excited about taking advantage of this new functionality...

 


<!-- Using ASP.NET FusionCharts v3.2.2.1 Wrapper and JavaScript rendering --><!-- START Script Block for Chart myNext303 -->
<div id='myNext303Div' >
Chart.
</div>
<script type="text/javascript">
if (FusionCharts && FusionCharts("myNext303")) 
FusionCharts("myNext303").dispose();
var chart_myNext303 = new FusionCharts(
	{"dataFormat" : "xml", 
	"scaleMode" : "noScale", 
	"renderAt" : "myNext303Div", 
	"id" : "myNext303", 
	"debugMode" : "0", 
	"lang" : "EN", 
	"swfUrl" : "FusionCharts/Column3D.swf", 
	"wMode" : "opaque", 
	"width" : "500", 
	"height" : "400", 
	"registerWithJS" : "1",
	"dataSource" : 
		"<graph caption='Divisional Accessorial Details' 
				subCaption='Fuel Surcharge - Ground' 
				xAxisName='' yAxisName='' 
				decimalPrecision='0' 
				formatNumberScale='0' 
				showNames='1' 
				numberPrefix='' 
				numberSuffix='' 
				enableSmartLabels ='1' 
				baseFontSize ='9' 
				outCnvBaseFont ='9' 
				showBorder='0' 
				bgColor ='EEEEEE' 
				canvasbgColor='EEEEEE' 
				labelStep='1' 
				showValues='0'  
				labelDisplay='Rotate' 
				slantLabels='1' >
			<styles> 
				<definition> 
					<style name='MyFirstFontStyle' type='font' font='Verdana' size='12' /> 
				</definition> 
				<application> 
					<apply toObject='Caption' styles='MyFirstFontStyle' /> 
				</application>  
			</styles> 
			<set name='Newark-Corp' value='207296' color='1941A5' toolText='207,296.00' link='DashBoard.aspx%3fID%3d45%26DID%3d16%26AID%3d12%27 />
			<set name='Newark-IT' value='202351' color='AFD8F8' toolText='202,351.00' link='DashBoard.aspx%3fID%3d45%26DID%3d17%26AID%3d12%27 />
			<set name='Anaheim-Parcel' value='190401' color='F6BD0F' toolText='190,401.00' link='DashBoard.aspx%3fID%3d45%26DID%3d18%26AID%3d12%27 />
			<set name='Anaheim-Freight' value='212726' color='8BBA00' toolText='212,726.00' link='DashBoard.aspx%3fID%3d45%26DID%3d19%26AID%3d12%27 />
			<set name='Tampa-Samples' value='167985' color='A66EDD' toolText='167,985.00' link='DashBoard.aspx%3fID%3d45%26DID%3d20%26AID%3d12%27 />
			<set name='Tampa-Returns' value='200791' color='F984A1' toolText='200,791.00' link='DashBoard.aspx%3fID%3d45%26DID%3d21%26AID%3d12%27 />
			<set name='Tampa-Corp' value='138377' color='CCCC00' toolText='138,377.00' link='DashBoard.aspx%3fID%3d45%26DID%3d22%26AID%3d12%27 />
			<set name='Tampa-Stores' value='155454' color='999999' toolText='155,454.00' link='DashBoard.aspx%3fID%3d45%26DID%3d23%26AID%3d12%27 />
			<set name='Tampa-Docs' value='196397' color='0099CC' toolText='196,397.00' link='DashBoard.aspx%3fID%3d45%26DID%3d24%26AID%3d12%27 />
			<set name='Lakeland-Corp' value='195165' color='FF0000' toolText='195,165.00' link='DashBoard.aspx%3fID%3d45%26DID%3d25%26AID%3d12%27 />
			<set name='Lakeland-Sales' value='270565' color='006F00' toolText='270,565.00' link='DashBoard.aspx%3fID%3d45%26DID%3d26%26AID%3d12%27 />
			<set name='NY-Madison' value='243340' color='0099FF' toolText='243,340.00' link='DashBoard.aspx%3fID%3d45%26DID%3d27%26AID%3d12%27 />
			<set name='NY-Sales' value='229336' color='FF66CC' toolText='229,336.00' link='DashBoard.aspx%3fID%3d45%26DID%3d28%26AID%3d12%27 />
			<set name='Princeton' value='189082' color='669966' toolText='189,082.00' link='DashBoard.aspx%3fID%3d45%26DID%3d29%26AID%3d12%27 />
		</graph>"
	}).render();
</script>
<!-- END Script Block for Chart myNext303 -->

 

Hi,

 

Please find attached illustration for your reference which uses RenderChart method.

 

Also, it is recommended to use <chart> alias for <graph>.

 

For more information, please refer the following URL:

http://docs.fusioncharts.com/charts/contents/guide-for-web-developers/csnet/CS_BasicExample.html

JSChart_ASP.NET.zip

Share this post


Link to post
Share on other sites

Well, as it turned out, the problem was that my links didn't have the proper single quote closing them. Apparently RenderChartHTML fixes quotes for you?

Thanks for the great product.

-Greg

 

 

 

Hi,

 

Please find attached illustration for your reference which uses RenderChart method.

 

Also, it is recommended to use <chart> alias for <graph>.

 

For more information, please refer the following URL:

http://docs.fusionch...sicExample.html

Share this post


Link to post
Share on other sites
Guest Sumedh

Well, as it turned out, the problem was that my links didn't have the proper single quote closing them. Apparently RenderChartHTML fixes quotes for you?

Thanks for the great product.

-Greg

 

 

 

 

 

Hi,

 

RenderChartHTML method is deprecated.

 

RenderChart method is the recommended method for rendering the charts.

 

For more information, refer the following URL:

http://docs.fusioncharts.com/charts/contents/?guide-for-web-developers/csnet/CS_BasicExample.html

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