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>Tooltip</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
/**
* @demo
*
*/
const config = {
asset: [{
type: 'pattern',
id: 'pattern-1',
pattern: 0,
style: {
stroke: 'white',
strokeWidth: '1px'
},
backgroundStyle: {
fill: '#0088ff'
}
}],
title: 'Hover Style',
legend: true,
body: {
style: {
stroke: 'none'
}
},
xAxis: {
tick: true,
title: {
text: '수정구'
}
},
yAxis: {
title: {
text: '전체 인구수'
},
unit: '(명)',
label: {
lastText: '${label}<br>${axis.unit}',
lastStyle: {
fontWeight: 'bold'
}
}
},
series: {
tooltipText: '<b>${name}</b><br>${series}:<b> ${yValue}</b>',
pointLabel: {
visible: true,
rotation: -90
},
hoverStyle: {
stroke: 'blue',
fill: 'url(#pattern-1)'
},
data: [
// { name: 'xxx', value: 11111, label: 3333},
['신흥1동', 13904], ['신흥2동', 19796], ['신흥3동', 10995], ['태평1동', 14625], ['태평2동', 14627], ['태평3동', 12649], ['태평4동', 12279]]
}
};
let animate;
let chart;
function init() {
console.log('RealChart v' + RealChart.getVersion());
// RealChart.setDebugging(true);
RealChart.setLogging(true);
chart = RealChart.createChart(document, 'realchart', config, true, () => {
console.log('LoADED!');
});
}