93 lines
2.5 KiB
HTML
93 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>Inverted axis chart with Range Annotations</title>
|
|
|
|
|
|
<link href="../../assets/styles.css" rel="stylesheet" />
|
|
|
|
<style>
|
|
#chart {
|
|
max-width: 650px;
|
|
margin: 35px auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="chart">
|
|
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/apexcharts@latest"></script>
|
|
<script src="../../assets/stock-prices.js"></script>
|
|
|
|
<script>
|
|
|
|
var options = {
|
|
annotations: {
|
|
yaxis: [{
|
|
y: 'United Kingdom',
|
|
y2: 'South Korea',
|
|
borderColor: '#FEB019',
|
|
label: {
|
|
borderColor: '#333',
|
|
style: {
|
|
fontSize: '10px',
|
|
color: '#333',
|
|
background: '#FEB019',
|
|
},
|
|
text: 'Y-axis range',
|
|
}
|
|
}],
|
|
xaxis: [{
|
|
x: 400,
|
|
x2: 800,
|
|
borderColor: '#00E396',
|
|
label: {
|
|
borderColor: '#00E396',
|
|
style: {
|
|
fontSize: '10px',
|
|
color: '#fff',
|
|
background: '#00E396',
|
|
},
|
|
offsetY: -10,
|
|
text: 'X-axis range',
|
|
}
|
|
}]
|
|
},
|
|
chart: {
|
|
height: 350,
|
|
type: 'bar',
|
|
},
|
|
plotOptions: {
|
|
bar: {
|
|
horizontal: true,
|
|
}
|
|
},
|
|
dataLabels: {
|
|
enabled: false
|
|
},
|
|
series: [{
|
|
data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380]
|
|
}],
|
|
xaxis: {
|
|
categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan', 'United States', 'China', 'Germany'],
|
|
}
|
|
}
|
|
|
|
var chart = new ApexCharts(
|
|
document.querySelector("#chart"),
|
|
options
|
|
);
|
|
|
|
chart.render();
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |