| | |
| | | xData: string[], |
| | | series: Array<{ name: string; data: number[] }>, |
| | | colors: string[] = [C.cyan, C.blue, C.purple], |
| | | horizontal = false, |
| | | ): EChartsOption { |
| | | return { |
| | | grid: { bottom: 40, left: 48, right: 16, top: 16 }, |
| | | grid: { bottom: 40, left: horizontal ? 140 : 48, right: 16, top: 16 }, |
| | | legend: { ...darkLegend, bottom: 0 }, |
| | | tooltip: { ...darkTooltip, axisPointer: { type: 'shadow' }, trigger: 'axis' }, |
| | | xAxis: { ...darkAxis, data: xData, type: 'category' }, |
| | | yAxis: { ...darkAxis, type: 'value' }, |
| | | xAxis: horizontal ? { ...darkAxis, type: 'value' } : { ...darkAxis, data: xData, type: 'category' }, |
| | | yAxis: horizontal ? { |
| | | ...darkAxis, data: xData, type: 'category', inverse: true, |
| | | axisLabel: { ...darkAxis.axisLabel, width: 125, overflow: 'truncate', interval: 0 }, |
| | | } : { ...darkAxis, type: 'value' }, |
| | | series: series.map((s, i) => ({ |
| | | barGap: '30%', |
| | | barMaxWidth: 36, |