首页 > 解决方案 > Highcharts X轴和y轴

问题描述

我正在使用 react-high-charts-official,我需要将 x 轴更改为字符串值,将 y 轴更改为示例:1%、2%、3%。我如何做到这一点?条形图尖端也应该是圆形的。

标签: reactjsreact-highcharts

解决方案


您可以使用轴标签格式化程序。参考:api.highcharts.com/highstock/yAxis.labels.formatter

 yAxis: {
  labels: {
    formatter: function () {
      return this.value + ' units';
    }
  },
 }

推荐阅读