132 lines
3.3 KiB
HTML
132 lines
3.3 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>Scatter Images</title>
|
|
|
|
|
|
<link href="../../assets/styles.css" rel="stylesheet" />
|
|
|
|
<style>
|
|
#chart {
|
|
max-width: 650px;
|
|
margin: 35px auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app"></div>
|
|
|
|
<div id="html">
|
|
<div id="chart"> <ReactApexChart options={this.state.options} series={this.state.series}
|
|
type="scatter" height="350" /> </div>
|
|
</div>
|
|
|
|
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
|
|
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
|
|
<script src="https://unpkg.com/prop-types@15.6.2/prop-types.min.js">
|
|
</script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/apexcharts@latest"></script>
|
|
<script src="https://unpkg.com/react-apexcharts@1.1.0/dist/react-apexcharts.iife.min.js"></script>
|
|
|
|
<script type="text/babel">
|
|
|
|
class ScatterChart extends React.Component {
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
|
|
this.state = {
|
|
options: {
|
|
chart: {
|
|
animations: {
|
|
enabled: false,
|
|
},
|
|
zoom: {
|
|
enabled: false,
|
|
},
|
|
toolbar: {
|
|
show: false
|
|
}
|
|
},
|
|
colors: ['#79A2F8', '#EF7EC9'],
|
|
xaxis: {
|
|
tickAmount: 10,
|
|
min: 0,
|
|
max: 40
|
|
},
|
|
yaxis: {
|
|
tickAmount: 7
|
|
},
|
|
markers: {
|
|
size: 20
|
|
},
|
|
fill: {
|
|
type: 'image',
|
|
opacity: 1,
|
|
image: {
|
|
src: ['../../assets/images/ico-messenger.png'],
|
|
width: 40,
|
|
height: 40
|
|
}
|
|
}
|
|
},
|
|
series: [{
|
|
data: [
|
|
[16.4, 5.4],
|
|
[21.7, 4],
|
|
[25.4, 3],
|
|
[19, 2],
|
|
[10.9, 1],
|
|
[13.6, 3.2],
|
|
[10.9, 7],
|
|
[10.9, 8.2],
|
|
[16.4, 4],
|
|
[13.6, 4.3],
|
|
[13.6, 12],
|
|
[29.9, 3],
|
|
[10.9, 5.2],
|
|
[16.4, 6.5],
|
|
[10.9, 8],
|
|
[24.5, 7.1],
|
|
[10.9, 7],
|
|
[8.1, 4.7],
|
|
[19, 10],
|
|
[27.1, 10],
|
|
[24.5, 8],
|
|
[27.1, 3],
|
|
[29.9, 11.5],
|
|
[27.1, 0.8],
|
|
[22.1, 2]
|
|
]
|
|
}],
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
<div id="chart">
|
|
<ReactApexChart options={this.state.options} series={this.state.series} type="scatter" height="350" />
|
|
</div>
|
|
<div id="html-dist">
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
const domContainer = document.querySelector('#app');
|
|
ReactDOM.render(React.createElement(ScatterChart), domContainer);
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|