I need to make default solid border of pie highchart to dashed. It's needed only for pie with no data or with negative data values. May be it's possible to redraw somehow svg of border (https://jsfiddle.net/g8vafrt5/13/): enter image description here

Highcharts.chart('container', {
   chart: {
        type: 'pie',
    },
        tooltip: {
        enabled: false
    },
   plotOptions: {
      pie: {
         dataLabels: {
            enabled: false,
         },
      },
      series: {
      showInLegend: true,
      },
    },
    series: [{
        innerSize: "40%",
        data: [{
            y: 0,
        }]
    }]
});

推荐答案

您可以在加载事件回调中编辑dashstyle属性.例如:

  chart: {
    type: 'pie',
    events: {
      load: function() {
        this.series[0].graph.attr({
          dashstyle: 'Dash'
        });
      }
    }
  }

Live demo:https://jsfiddle.net/BlackLabel/cqgm6nhu/

API Reference:https://api.highcharts.com/class-reference/Highcharts.SVGElement#attr

Javascript相关问答推荐

Codemirsor 6语言包的使用部分是什么?

订阅操作顺序

错误:(0,react__WEBPACK_IMPORTED_MODULE_1__.useSYS State)不是函数或其返回值不可迭代

在JavaScript中打开和关闭弹出窗口

使用useParams路由失败

为什么我的includes声明需要整个字符串?

在Angular中将样式应用于innerHTML

在观察框架中搜索CSV数据

cypress中e2e测试上的Click()事件在Switch Element Plus组件上使用时不起作用

使用JQuery单击元素从新弹出窗口获取值

使用Java脚本导入gltf场景并创建边界框

为什么我的getAsFile()方法返回空?

如何在使用rhandsontable生成表时扩展数字输入验证?

如何将zoom 变换应用到我的d3力有向图?

每次重新呈现时调用useState initialValue函数

无法重定向到Next.js中的动态URL

未捕获语法错误:Hello World中的令牌无效或意外

Node.js错误: node 不可单击或不是元素

有没有办法通过使用不同数组中的值进行排序

将Singleton实例设置为未定义后的Angular 变量引用持久性行为