JSFiddle - React, Tailwind, and code Playground
by heavell
HTML
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
backgroundColor: 'transparent',
exportEnabled: false,
title: '',
axisX: {
lineColor: '#1D2939',
tickColor: '#1D2939',
gridColor: '#1D2939',
labelFontColor: '#667085',
labelFontSize: 12,
margin: 20,
interval: 1
},
axisY: {
prefix: '',
title: '',
lineColor: '#1D2939',
tickColor: '#1D2939',
gridColor: '#1D2939',
labelFontColor: '#667085',
labelFontSize: 12,
interval: 1000
},
axisY2: {
prefix: '',
title: '',
lineColor: '#1D2939',
tickColor: '#1D2939',
gridColor: '#1D2939',
labelFontColor: '#667085',
labelFontSize: 12,
interval: 1000
},
data: [
{
type: 'boxAndWhisker',
upperBoxColor: 'transparent',
lowerBoxColor: 'transparent',
showInLegend: false,
color: '#F04438',
axisYType: 'primary',
gap: 20,
dataPoints: [
{ label: 'KA_S1#12345', y: [1900, 3100, 4500, 3500, 4500] },
{ label: 'KA_S1#12346', y: [2000, 1000, 3000, 4500, 1500] },
{ label: 'KA_S1#12347', y: [4500, 2500, 4800, 2569, 1533] }
]
},
{
type: 'boxAndWhisker',
upperBoxColor: 'transparent',
lowerBoxColor: 'transparent',
color: '#32D583',
showInLegend: false,
gap: 20,
axisYType: 'secondary',
dataPoints: [
{ label: 'KA_S1#12345', y: [1200, 1100, 1500, 2500, 3500] },
{ label: 'KA_S1#12346', y: [5000, 3000, 2000, 3500, 2500] },
{ label: 'KA_S1#12347', y: [1500, 4500, 1800, 4569, 4533] }
]
}
]
});
chart.render();