如果您的React项目中使用了Apexchart,并且出现了面积图选择缩放无法正常工作的问题,可以使用以下步骤解决:
npm install react-apexcharts --save
import ReactApexChart from 'react-apexcharts';
const options = { chart: { id: 'areaChart', zoom: { enabled: true, type: 'x', resetIcon: { offsetX: -10, offsetY: 0, fillColor: '#fff', strokeColor: '#37474F' }, selection: { background: '#90CAF9', brush: { color: '#f8bbd0', opacity: 0.1 }, border: { color: '#455A64', opacity: 0.2, width: 1 } } } }, dataLabels: { enabled: false }, stroke: { curve: 'smooth' }, fill: { type: 'gradient', gradient: { shadeIntensity: 1, opacityFrom: 0.7, opacityTo: 0.9, stops: [0, 100] } }, tooltip: { x: { show: true, format: 'dd MMM yyyy' }, }, xaxis: { type: 'datetime' } };
const series = [{ name: 'series1', data: [{ x: '04/05/2021', y: 20 }, { x: '04/06/2021', y: 10 }, { x: '04/07/2021', y: 30 }, { x: '04/08/2021', y: 20 }, { x: '04/09/2021', y: 25