【问题标题】:In Fusiontime charts, can we change the formatting of yaxis values?在 Fusiontime 图表中,我们可以更改 yaxis 值的格式吗?
【发布时间】:2023-01-04 13:52:43
【问题描述】:

我正在使用 fusioncharts 来显示加密的指标,所以如果以十亿为单位的值显示为千兆,我可以将格式更改为十亿吗?enter image description here

我更改了decimals: 2这样的格式,并希望用 B 显示十亿数据

【问题讨论】:

    标签: fusioncharts


    【解决方案1】:

    是的,您可以在格式化属性下返回一个方法来格式化 y 轴数字,下面是一个 sn-p -

    format: {
        formatter: obj => {
          if (obj.type === "axis") {
            return `${obj.value / 1000000000}B`
          }
          return obj.value.toString().replace(".", ",");
    } 
    

    演示 - https://jsfiddle.net/r0fbpsqj/

    【讨论】:

      猜你喜欢
      • 2023-02-03
      • 1970-01-01
      • 2013-04-15
      • 2019-05-24
      • 1970-01-01
      • 1970-01-01
      • 2012-03-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多