JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;">
</div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
toolTip: {
shared: true,
},
title:{
text: "Customized toolTip Content"
},
axisX:{
prefix: "Simulando "
},
data: [
{
type: "stackedColumn",
toolTipContent: " Simulando {x} <br/> <span style='\"'color: {color};'\"'>{name}:</span> {y}",
name: "Q1",
dataPoints: [
{ y: 2.25, x: 1},
{ y: 3.66, x: 2},
{ y: 5.18, x: 3},
{ y: 5.50, x: 4},
{ y: 6.75, x: 5},
{ y: 8.57, x: 6},
{ y: 10.64, x: 7}
]
},
{
type: "stackedColumn",
name: "Q2",
dataPoints: [
{ y: 2.45, x: 1},
{ y: 3.87, x: 2},
{ y: 5.36, x: 3},
{ y: 5.52, x: 4},
{ y: 6.82, x: 5},
{ y: 9.02, x: 6},
{ y: 11.80, x: 7}
]
},
{
type: "stackedColumn",
name: "Q3",
dataPoints: [
{ y: 2.68, x: 1},
{ y: 4.23, x: 2},
{ y: 5.54, x: 3},
{ y: 5.94, x: 4},
{ y: 7.28, x: 5},
{ y: 9.72, x: 6},
{ y: 13.30, x: 7}
]
}
]
});
chart.render();