首页 / 浏览问题 / WebGIS / 问题详情
supermap graphTextFormat 可以自定义吗
4EXP 2021年08月27日
graphText: new SuperMap.ThemeGraphText({
        graphTextDisplayed: true,
        graphTextFormat: SuperMap.ThemeGraphTextFormat.CAPTION_VALUE,
        //graphTextFormat:"CAPTION_VALUE"+"kg", //如果不加kg没问题,加上kg这样会报错
        graphTextStyle: new SuperMap.ServerTextStyle({
          sizeFixed: false,
          fontHeight: 110,
          rotation:10,
          fontName:"黑体"

        })
      }),

效果图

我想在数值后边加上单位 kg

但是 graphTextFormat:  好像是枚举类型 ,只有5个选择 ,自定义之后会报错

官方api

我要怎么做才可以实现我想要的功能?

1个回答

您好,不能实现graphTextFormat:"CAPTION_VALUE"+"kg",您可以在items中对caption进行单位标注,如:caption: "复合肥(单位:kg)"
1,000EXP 2021年08月30日
...