胜利本机:图表未显示Y轴的第一个标签

问题描述

Y轴未显示0值

 <VictoryChart
                padding={{left: 75,top: 50,right: 50,bottom: 50}}
                width={Dimensions.get('window').width}
                theme={VictoryTheme.material}>
                <VictoryBar
                  style={{
                    data: {fill: colors.barColor,border: 0},axis: {stroke: 'transparent'},ticks: {stroke: 'transparent'},tickLabels: {fill: 'transparent'},}}
                  data={profitFlowResponse.data.values}
                  x="displayName"
                  y="income"
                />
                <VictoryAxis
                  dependentAxis
                  tickValues={Math.max(
                    profitFlowResponse.data.values.map((item) => item.income),)}
                  domain={{
                    y: [
                      0,Math.ceil(
                        Math.max(
                          ...profitFlowResponse.data.values.map(
                            (item) => item.income,),],}}
                  tickFormat={(t) => `${currency.symbol}${nFormatter(t,2)}`}
                  style={{
                    grid: {stroke: colors.invoiceDivider,strokeWidth: 0.5},axis: {stroke: 'none'},}}
                />
                <VictoryAxis
                  fixLabelOverlap={true}
                  style={{
                    tickLabels: {
                      angle: -45,padding: moderateScale(16),},grid: {strokeWidth: 0},}}
                  tickValues={profitFlowResponse.data.values.map(
                    (item) => item.displayName,)}
                />
              </VictoryChart>

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)