Skip to content

Instantly share code, notes, and snippets.

@rubensayshi
Created May 10, 2012 16:01
Show Gist options
  • Save rubensayshi/2654110 to your computer and use it in GitHub Desktop.
Save rubensayshi/2654110 to your computer and use it in GitHub Desktop.
FusionCharts Y_Y
<script type='text/javascript' src='/statics/Charts/v3/FusionCharts.js'></script>
<div id="chart"></div>
<script type='text/javascript'>
window.addEvent('load', function() {
categoryJSON = '{"category":[{"label":"19-09-2011"},{"label":"20-09-2011"}]}';
dataJSON = '{"seriesname":"visitors total","renderas":"line","color":"8e8c6d","data":[{"value":0,"total":0,"date":"19-09-2011","toolText":"-"},{"value":0,"total":0,"date":"20-09-2011","toolText":"-"}],"parentYAxis":"S"}';
JSON = '{"chart":{"showLegend":"1","anchorRadius":"2","drawAnchors":"1","anchorAlpha":"100","canvasBorderThickness":"1","formatNumber":"1","formatNumberScale":"0","thousandSeparator":".","canvasBorderColor":"DADADA","showValues":"0","labelDisplay":"Rotate","slantLabels":"1","showBorder":"0","chartrightmargin":"5","bgColor":"FFFFFF","animation":"0","canvasPadding":"0","PYAxisName":"Main","SYAxisName":"AdHese","labelStep":7},';
JSON += '"categories":['+categoryJSON+'],"dataset":['+dataJSON+']';
JSON += ',"styles":{"definition":[{"name":"RED","type":"FONT","color":"FF0000","bgcolor":"FF0000"}],"application":[{"toobject":"Canvas","styles":"RED"}]}';
JSON += '}';
console.log(JSON);
eval('JSONd = ' + JSON);
console.log(JSONd);
var TotalDailyChart = new FusionCharts("statics/Charts/v3/MSCombiDY2D.swf", "chartId", "942", "350", "0", "1");
TotalDailyChart.setJSONData(JSONd);
TotalDailyChart.render("chart");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment