// This code creates a chart with random data that regenerates when you click the button created in the
second code snippet below
$(document).ready(function () {
$("#wijbarchart").wijbarchart({
seriesList: [createRandomSeriesList("2013")],
seriesTransition: {
duration: 800,
easing: "easeOutBounce"
}
});
} );
function reload() {
$("#wijbarchart").wijbarchart("option", "seriesList", [createRandomSeriesList("2013")]);
}
function createRandomSeriesList(label) {
var data = [],
randomDataValuesCount = 12,
labels = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"],
idx;
for (idx = 0; idx < randomDataValuesCount; idx++) {
data.push(Math.round(Math.random() * 100));
}
return {
label: label,
legendEntry: false,
data: { x: labels, y: data }
};
}