Skip to content

Instantly share code, notes, and snippets.

@wixshow
Created October 23, 2018 16:29
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 wixshow/98f25c90f9e1771bff5e76a222d73e50 to your computer and use it in GitHub Desktop.
Save wixshow/98f25c90f9e1771bff5e76a222d73e50 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
<style>
</style>
<script>
window.onmessage = function(event){
if (event.data) {
makeChart(event.data);
}
};
function makeChart(dataValues) {
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: dataValues,
// Configuration options go here
options: {
tooltips: {enabled: false},
hover: {mode: null},
animation: {
duration: 0, // general animation time
},
hover: {
animationDuration: 0, // duration of animations when hovering an item
},
responsiveAnimationDuration: 0, // animation duration after a resize
}
});
}
</script>
</head>
<body style="background-Color:#b7a465">
<canvas id="myChart"></canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment