FusionCharts.ready(function() {
// write a function which creates a thumbnail of the required dimensions but turning off some of the properties which are not required in a thumbnail, for some other charts there might be a few more additional proeprties that need to be turned off.
var createThumbNail = function (chartId, width, height, divId) {
// we clone the chart first and then set new width and height
var chartRef = FusionCharts(chartId),
clonedChart = chartRef.clone({
"width": width,
"height": height
});
// turn off properties which are not required
clonedChart.setChartAttribute({
"showValues": "0",
"showLabels": "0",
"animation": "0",
"exportEnabled": "0",
"showTooltip": "0",
"showHoverEffect": "0",
"showYAxisValues": "0",
"caption": "",
"subCaption": "",
"xAxisName": "",
"yAxisName": "",
"showXAxisLine": "0",
"showYAxisLine": "0",
"numDivLines": "0",
"enableSlicing": "0",
"enableRotation": "0",
"numVisiblePlot": "24",
});
// listend for the chartClick event to render the detailed chart
clonedChart.addEventListener('chartClick', function () {
FusionCharts(chartId).render('chart-container');
});
// create the thumbnail
clonedChart.render(divId, 'append');
};
// since data is common for all three charts, we store it in a common variable
var chartData = {
"chart": {
"caption": "Sales Trends",
"subcaption": "FY 2012 - FY 2013",
"xaxisname": "Month",
"yaxisname": "Revenue",
"showvalues": "1",
"placeValuesInside": "1",
"rotateValues": "1",
"valueFontColor": "#ffffff",
"numberprefix": "$",
"baseFontColor":...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.