Skip to content

Commit a6111c6

Browse files
committed
Added Examples
1 parent f117250 commit a6111c6

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

examples/Example 1.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<html>
2+
<head>
3+
<script type="text/javascript">
4+
window.onload = function() {
5+
var chart = new CanvasJS.Chart("chartContainer", {
6+
theme: "light2", // "light1", "dark1", "dark2"
7+
animationEnabled: true,
8+
exportEnabled: true,
9+
title: {
10+
text: "Basic Column Chart"
11+
},
12+
data: [{
13+
// Change type to "bar", "area", "spline", "pie",etc.
14+
type: "column",
15+
dataPoints: [{
16+
label: "apple",
17+
y: 10
18+
}, {
19+
label: "orange",
20+
y: 15
21+
}, {
22+
label: "banana",
23+
y: 25
24+
}, {
25+
label: "mango",
26+
y: 30
27+
}, {
28+
label: "grape",
29+
y: 28
30+
}]
31+
}]
32+
});
33+
chart.render();
34+
//CanvasJSDataAsJSON(chart, ["Filename"]); //Filename is optional - defaults to "chart-data"
35+
CanvasJSDataAsJSON(chart, "Chart Data");
36+
}
37+
</script>
38+
</head>
39+
40+
<body>
41+
<div id="chartContainer" style="height: 400px; width: 60%;margin: auto;"></div>
42+
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>
43+
<script src="../dist/canvasjsasjson.min.js"> </script>
44+
</body>
45+
46+
</html>

examples/Example 2.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<html>
2+
<head>
3+
<script type="text/javascript">
4+
window.onload = function() {
5+
var chart = new CanvasJS.Chart("chartContainer", {
6+
theme: "light2", // "light1", "dark1", "dark2"
7+
animationEnabled: true,
8+
title: {
9+
text: "Basic Column Chart"
10+
},
11+
data: [{
12+
// Change type to "bar", "area", "spline", "pie",etc.
13+
type: "column",
14+
dataPoints: [{
15+
label: "apple",
16+
y: 10
17+
}, {
18+
label: "orange",
19+
y: 15
20+
}, {
21+
label: "banana",
22+
y: 25
23+
}, {
24+
label: "mango",
25+
y: 30
26+
}, {
27+
label: "grape",
28+
y: 28
29+
}]
30+
}]
31+
});
32+
chart.render();
33+
//CanvasJSDataAsJSON(chart, ["Filename"]); //Filename is optional - defaults to "chart-data"
34+
CanvasJSDataAsJSON(chart, "Chart Data");
35+
}
36+
</script>
37+
</head>
38+
39+
<body>
40+
<div id="chartContainer" style="height: 400px; width: 60%;margin: auto;"></div>
41+
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"> </script>
42+
<script src="../dist/canvasjsasjson.min.js"> </script>
43+
</body>
44+
45+
</html>

0 commit comments

Comments
 (0)