prokat/api/jquery/plugins/canvasjs/canvasjs-chart-3.10.1/examples/11-integration/jquery-spline-chart-with-image-export.html
2025-06-16 18:28:08 +05:00

41 lines
902 B
HTML
Executable File

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<script>
window.onload = function () {
//Better to construct options first and then pass it as a parameter
var options = {
title: {
text: "Spline Chart with Export as Image"
},
animationEnabled: true,
exportEnabled: true,
data: [
{
type: "spline", //change it to line, area, column, pie, etc
dataPoints: [
{ x: 10, y: 10 },
{ x: 20, y: 12 },
{ x: 30, y: 8 },
{ x: 40, y: 14 },
{ x: 50, y: 6 },
{ x: 60, y: 24 },
{ x: 70, y: -4 },
{ x: 80, y: 10 }
]
}
]
};
$("#chartContainer").CanvasJSChart(options);
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; max-width: 920px; margin: 0px auto;"></div>
<script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script src="../../jquery.canvasjs.min.js"></script>
</body>
</html>