JSFiddle - React, Tailwind, and code Playground
by juvancica
HTML
<div align="center" id="eChart" style="width: 100%; height: 500px;">
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.9.0-rc.1/echarts-en.min.js" integrity="sha512-yT7ns3Drvl+Fi4DxGXYOGF7CtPX94lhBcgjDRTeZWaaD4MUMQ1eFI4lH2eQx1CYMuxwyN+vPvUeukycLcBkT8Q==" crossorigin="anonymous"></script>
<script>
var podatki = [
['Leto', 'Prenesene nerešene ovadbe', 'Prejete ovadbe', 'Rešene ovadbe', 'Ovadbe v delu na zadnji dan leta'],
[2015, 15223, 26247, 29594, 12895],
[2016, 12602, 25286, 27204, 11592],
[2017, 11602, 25672, 26201, 11501],
[2018, 11226, 25838, 26497, 11150],
[2019, 11131, 25657, 26169, 10619],
[2020, 10619, 12788, 13254]
];
var eChart1 = echarts.init(document.getElementById('eChart'));
eChart1.setOption({
legend: {},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: ''
},
dataset: {
source: podatki
},
xAxis: {
type: 'category'
},
yAxis: {},
// Declare several bar series, each will be mapped
// to a column of dataset.source by default.
series: (function() {
res = [];
for (i = 0; i < podatki[0].length - 1; i++) {
res.push({
type: 'bar'
});
}
return res;
})()
});
</script>