JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html><html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dumbbell</title>
<style>
html {
margin: 0px;
}
body {
margin: 20px 30px;
}
#realchart {
width: 850px;
height: 550px;
border: 1px solid lightgray;
margin-bottom: 20px;
}
</style>
<link href="https://unpkg.com/realchart/realchart-style.css" rel="stylesheet" crossorigin="anonymous">
<script type="text/javascript" src="https://unpkg.com/realchart/index"></script>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function () {
try {
init();
} catch (err) {
alert(err);
console.error(err);
}
});
</script>
<script>
var realChartLic = 'upVcPE+wPOkOR/egW8JuxkM/nBOseBrflwxYpzGZyYkhw7qfHRQ+GiF0lY62mJi5KBwoSJHOA48O5+/xJSE3LhLB4LkQ8rWX0QeIbtyyIEGTFVqWmNPdyQ==';
</script>
</head>
<body>
<div id="realchart"></div>
</body></html>
JavaScript
const config = {
title: "Dumbbell Series",
xAxis: {
grid: true,
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {},
series: {
type: 'dumbbell',
tooltipText: 'low: ${low}<br>high: ${yValue}<br>',
pointLabel: {
visible: true
},
data: [[-13.9, 5.2], [-16.7, 10.6], [-4.7, 11.6], [-4.4, 16.8], [-2.1, 27.2], [5.9, 29.4], [6.5, 29.1], [4.7, 25.4], [4.3, 21.6], [-3.5, 15.1], [-9.8, 12.5], [-11.5, 8.4]]
}
};
let chart;
function init() {
console.log('RealChart v' + RealChart.getVersion());
RealChart.setLogging(false);
chart = RealChart.createChart(document, 'realchart', config);
}