Графики Победы выравнивают все столбцы централизованно - PullRequest
0 голосов
/ 30 марта 2020

По умолчанию Victory разбрасывает все бары по всему графику: enter image description here

И код:

<VictoryChart
    width={650}
    theme={VictoryTheme.material}
    domainPadding={30}
  >
    <VictoryAxis
      tickFormat={data.map(x => x.title)}
      style={{
        axis: { stroke: 'rgb(236, 239, 241)', strokeWidth: 1, strokeDasharray: [10, 5]},
        grid: { stroke: false },
        ticks: { stroke: 'none', size: 0 },
        tickLabels: { fontSize: 12, padding: 15 }
      }}
    />
    <VictoryAxis
      crossAxis={false}
      domain={[0, 2000]}
      dependentAxis
      tickFormat={x => x}
      style={{
        axis: { stroke: false },
        axisLabel: { fontSize: 12, padding: 50 },
        ticks: { stroke: 'none', size: 0 },
        tickLabels: { size: 0, padding: 20 }
      }}
    />
    <VictoryBar
      data={dataset}
      y="value"
      x="title"
      style={{
        data: { fill: ({ datum }) => datum.color },
      }}
    />
  </VictoryChart>

Как отцентрировать их и сделать среднее точка входа для рассеяния? Я ищу что-то вроде упора для root компонента диаграммы

...