| 235 | const { data } = createMillionPointsData(); |
| 236 | |
| 237 | const createUserOptions = (sampling: SeriesSampling, autoBounds: 'visible' | 'global'): ChartGPUOptions => ({ |
| 238 | grid: { left: 70, right: 24, top: 24, bottom: 44 }, |
| 239 | xAxis: { type: 'value', min: 0, max: X_MAX, name: 'Index' }, |
| 240 | yAxis: { type: 'value', autoBounds, name: 'Value' }, |
| 241 | tooltip: { show: false }, |
| 242 | dataZoom: [{ type: 'inside' }, { type: 'slider' }], |
| 243 | palette: ['#4a9eff'], |
| 244 | animation: false, |
| 245 | series: [ |
| 246 | { |
| 247 | type: 'line', |
| 248 | name: '1,000,000 points', |
| 249 | data, |
| 250 | color: '#4a9eff', |
| 251 | lineStyle: { width: 1, opacity: 1 }, |
| 252 | sampling, |
| 253 | samplingThreshold: DEFAULT_SAMPLING_THRESHOLD, |
| 254 | }, |
| 255 | ], |
| 256 | }); |
| 257 | |
| 258 | const applyAutoBounds = ( |
| 259 | resolved: ResolvedChartGPUOptions, |