云
13 小时以前 973574fd62a1a130a1c229f812e70cfe3763b48e
src/views/bi/dashboard/chart-options.ts
@@ -40,13 +40,17 @@
  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,