function showChart(){
let config = {
title: "Sample 04",
width: "800",
height: "600",
thousandsSeparator: ".",
decimalSeparator: ",",
transitionTime: 4,
logarithmicXaxis: true,
measures: [{ title: "Revenue", prefix: "$" }],
groups: ["Reseller", "Internet"],
data: [
{ item: "Company A", period: "2020", val: 100000000, val2: 800000000 },
{ item: "Company B", period: "2020", val: 450000, val2: 550000 },
{ item: "Company C", period: "2020", val: 650, val2: 750 },
{ item: "Company A", period: "2021", val: 1300000000, val2: 900000000 },
{ item: "Company B", period: "2021", val: 80000, val2: 120000 },
{ item: "Company C", period: "2021", val: 950, val2: 1950 },
{ item: "Company A", period: "2022", val: 1550000000, val2: 1250000000 },
{ item: "Company B", period: "2022", val: 800000, val2: 700000 },
{ item: "Company C", period: "2022", val: 1500, val2: 2500 },
{ item: "Company A", period: "2023", val: 2230000000, val2: 3230000000 },
{ item: "Company B", period: "2023", val: 1300000, val2: 4300000 },
{ item: "Company C", period: "2023", val: 2800, val2: 3800 },
]
}
kyubitTimeCharts.showButterflyChart("chartDiv", config);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sample 04</title>
<script type="text/javascript" src="KyubitTimeCharts.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event)
{
showChart();
});
function showChart()
{
let config = {
title: "Sample 04",
width: "800",
height: "600",
thousandsSeparator: ".",
decimalSeparator: ",",
transitionTime: 4,
logarithmicXaxis: true,
measures: [{ title: "Revenue", prefix: "$" }],
groups: ["Reseller", "Internet"],
data: [
{ item: "Company A", period: "2020", val: 100000000, val2: 800000000 },
{ item: "Company B", period: "2020", val: 450000, val2: 550000 },
{ item: "Company C", period: "2020", val: 650, val2: 750 },
{ item: "Company A", period: "2021", val: 1300000000, val2: 900000000 },
{ item: "Company B", period: "2021", val: 80000, val2: 120000 },
{ item: "Company C", period: "2021", val: 950, val2: 1950 },
{ item: "Company A", period: "2022", val: 1550000000, val2: 1250000000 },
{ item: "Company B", period: "2022", val: 800000, val2: 700000 },
{ item: "Company C", period: "2022", val: 1500, val2: 2500 },
{ item: "Company A", period: "2023", val: 2230000000, val2: 3230000000 },
{ item: "Company B", period: "2023", val: 1300000, val2: 4300000 },
{ item: "Company C", period: "2023", val: 2800, val2: 3800 },
]
}
kyubitTimeCharts.showButterflyChart("chartDiv", config);
}
</script>
</head>
<body>
<div id="chartDiv"></div>
</body>
</html>