Skip to content

Instantly share code, notes, and snippets.

@lohithgn
Created November 22, 2016 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lohithgn/1d18ac5a32f46cdaf52abed12d9fd1b1 to your computer and use it in GitHub Desktop.
Save lohithgn/1d18ac5a32f46cdaf52abed12d9fd1b1 to your computer and use it in GitHub Desktop.
Kendo UI Chart - instantiatig the chart
<script>
function createChart() {
$("#chart").kendoChart({
title: {
text: "Gross domestic product growth \n (GDP annual %)"
},
seriesDefaults: {
type: "area",
area: {
line: {
style: "smooth"
}
}
},
series: [{
name: "India",
data: [3.907, 7.943, 7.848, 9.284, 9.263, 9.801, 3.890, 8.238, 9.552, 6.855]
}, {
name: "World",
data: [1.988, 2.733, 3.994, 3.464, 4.001, 3.939, 1.333, -2.245, 4.339, 2.727]
}, {
name: "Haiti",
data: [-0.253, 0.362, -3.519, 1.799, 2.252, 3.343, 0.843, 2.877, -5.416, 5.590]
}],
categoryAxis: {
categories: [2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011],
majorGridLines: {
visible: false
},
labels: {
rotation: "auto"
}
},
tooltip: {
visible: true,
format: "{0}%",
template: "#= series.name #: #= value #"
}
});
}
$(document).ready(createChart);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment