JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/nnnick/Chart.js/v1.0.2/Chart.min.js"></script>
<canvas id="myChart1" height="300" width="500"></canvas>
<canvas id="myChart2" height="300" width="500"></canvas>
JavaScript
var chartData = {
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [
{
fillColor: "#79D1CF",
strokeColor: "#79D1CF",
data: [60, 80, 81, 56, 55, 40]
},
{
fillColor: "#D1CF79",
strokeColor: "#D1CF79",
data: [80, 81, 56, 55, 40, 60]
}
]
};
var ctx = document.getElementById("myChart1").getContext("2d");
var myLine = new Chart(ctx).Line(chartData, {
showTooltips: false,
onAnimationComplete: function () {
var ctx = this.chart.ctx;
ctx.font = this.scale.font;
ctx.textAlign = "center";
ctx.textBaseline = "bottom";
this.datasets.forEach(function (dataset, i) {
ctx.fillStyle = dataset.fillColor;
dataset.points.forEach(function (points) {
ctx.fillText(points.value, points.x, 20 + 20 * i);
});
})
}
});