【问题标题】:Highcharts: how to add custom SVG icon on custom stock-tool button?Highcharts:如何在自定义股票工具按钮上添加自定义 SVG 图标?
【发布时间】:2021-02-21 06:06:53
【问题描述】:

我有这个jsfiddle 代码,其中我定义了一个自定义stock-tool 按钮,例如:

  lang: {
    stockTools: {
      gui: {
        customAnnotation: 'Custom action'
      }
    },
    navigation: {
      popup: {
        customAnnotation: 'Action config'
      }
    }
  },
  stockTools: {
    gui: {
      enabled: true,
      buttons: [ 'customAnnotation','customAnnotation','customAnnotation' ],
      definitions: {
        customAnnotation: {
          className: 'highcharts-custom-annotation',
          symbol: 'text.svg'
        }
      }
    }
  }

并且按钮的SVG 图标由symbol: 'text.svg' 行定义。该图标来自this link 中预定义的higcharts 图标。 我想知道,如何将SVG 图标设置为指向我自定义创建的SVG 图标?

【问题讨论】:

    标签: javascript svg highcharts


    【解决方案1】:

    你需要使用iconsURL属性:

    navigation: {
      iconsURL: '...',
      ...
    }
    

    现场演示: https://jsfiddle.net/BlackLabel/g9hct52j/

    API 参考: https://api.highcharts.com/highstock/navigation.iconsURL

    文档: https://www.highcharts.com/docs/stock/stock-tools

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多