Basic example using dataStr method (with JSON data hard-coded in ASP page itself)
<%
'This page demonstrates the ease of generating charts using FusionCharts.
'For this chart, we've used a string variable to contain our entire JSON data.
'Ideally, you would generate/retrieve JSON data documents at run-time, after interfacing with
'forms or databases etc.Such examples are also present.
'Here, we've kept this example very simple.
'Create an JSON data document in a string variable
strJSON = "{""chart"":{""caption"":""Monthly Unit Sales"", ""xaxisname"":""Month"",""yaxisname"":""Units"", ""showvalues"":""0"",""formatnumberscale"":""0"", ""showborder"":""1"" },""data"":[{ ""label"":""Jan"", ""value"":""462"" },{ ""label"":""Feb"", ""value"":""857"" },{ ""label"":""Mar"", ""value"":""671"" },{ ""label"":""Apr"", ""value"":""494"" },{ ""label"":""May"", ""value"":""761"" },{ ""label"":""Jun"", ""value"":""960"" },{ ""label"":""Jul"", ""value"":""629"" },{ ""label"":""Aug"", ""value"":""622"" },{ ""label"":""Sep"", ""value"":""376"" }, { ""label"":""Oct"", ""value"":""494"" },{ ""label"":""Nov"", ""value"":""761"" },{ ""label"":""Dec"", ""value"":""960"" }]}"
' set chart data format to json
FC_SetDataFormat("json")
'Create the chart - Column 3D Chart with data from strJSON variable using dataStr method
Call renderChart("../../FusionCharts/Column3D.swf", "", strJSON, "myNext", 600, 300, false, true)
%>
If you view the source of this page, you'll see that the JSON data is present in this same page (inside HTML code). We're not calling any external JSON (or script) files to serve JSON data. dataStr method is ideal when you've to plot small amounts of data.