1. X 轴文字过长,发生重叠

  1. //chartList是数据 当横坐标大于15个值得时候,关闭自动旋转,自定义设置旋转角度12度
  2. <Axis name="text" label = {{
  3. rotate: chartList.length > 15 ? 12 : 0,
  4. autoRotate: chartList.length > 15 ? false : true,
  5. offset: 30, //X轴文字距离X轴得距离 让文字离开表中 或者用下面的字段,文本对齐方向从头部对齐
  6. textStyle: chartList.length > 15 ? {
  7. textAlign: 'start '
  8. } : {} ,
  9. }}/>

2.隐藏Gemo、Axis

  1. // 方案一
  2. <Geom opacity={0} />
  3. <Axis visible={false} />
  4. // 方案二
  5. <Chart padding={0} />

3.坐标轴参考线设置

  1. <Axis name="population"
  2. grid={{
  3. // align: 'center',
  4. lineStyle: {
  5. stroke: 'red', // 网格线的颜色
  6. lineWidth: 1, // 网格线的宽度复制代码
  7. }
  8. }}
  9. />

4.指定坐标轴刻度点的个数

  1. <Chart
  2. scale={{
  3. tickCount: number, // 坐标轴上刻度点的个数,不同的度量类型对应不同的默认值
  4. // tickInterval: number, // 用于指定坐标轴各个标度点的间距,是原始数据之间的间距差值,tickCount 和 tickInterval 不可以同时声明
  5. }}
  6. >
  7. ...
  8. </Chart>

5.解决 Bizcharts高度多出几个px的问题

  1. <Chart
  2. className="xxx" //设置图表最外层div的类名。 可通过用css设定外层容器的高度
  3. style={{xxx: yyy}} // 设置图表最外层div的样式
  4. >
  5. ...
  6. </Chart>