【问题标题】:how to remove percentage from tooltip from AmChart.React pie chart如何从 AmChart.React 饼图中的工具提示中删除百分比
【发布时间】:2019-04-23 18:24:32
【问题描述】:

我正在使用带有 react 的 amchart,它适用于所有事情,但我有一个问题,我不想在工具提示上显示百分比

这里我只想显示波立维:457 而不是百分比

 <AmCharts.React
        style={{
            width: "100%",
            height: "500px",
            marginTop: "-20px"
        }}
        options={{
            "type": "pie",
            "labelRadius": -35,
            "labelText": "[[count]]",
            "titles": titles,
            "theme": "light",
            "growSlices": true,
            "innerRadius": "0%",
            "dataProvider": reqData,
            "valueField": "count",
            "titleField": "name",
            "colorField": "color"
        }}/>

这是我的代码

【问题讨论】:

    标签: reactjs amcharts


    【解决方案1】:

    只是通过添加 balloonText 属性来实现的

    <AmCharts.React
        style={{
            width: "100%",
            height: "500px",
            marginTop: "-20px"
        }}
        options={{
            "type": "pie",
            "labelRadius": -35,
            "labelText": "[[count]]",
            "titles": titles,
            "theme": "light",
            "growSlices": true,
            "innerRadius": "0%",
            "dataProvider": reqData,
            "valueField": "count",
            "titleField": "name",
            "colorField": "color",
            "balloonText": "[[name]]: [[count]]"
        }}/>
    

    "balloonText": "任意字符串"

    【讨论】:

      猜你喜欢
      • 2014-02-22
      • 1970-01-01
      • 1970-01-01
      • 2014-08-28
      • 1970-01-01
      • 2021-12-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多