Highcharts - Guage - 改变中心黑点(圆)的颜色和半径

Highcharts - Guage - Changing the color and radius of the center black dot(circle)

http://jsfiddle.net/fwxbfu1u/2/

这是 highcharts 量表的 jsfiddle。我试图更改所有选项并自定义图表。但是想不出改变中心点的半径和颜色的方法。

如下图所示

In this example .. how do i change the color and radius of the centre black dot.?

假设包含gauge的div的id是"container"

var circle = $( "#container").find('circle');
$(circle).attr("r", 7 );
$(circle).attr("fill", 'green' ); 
$("#container").find("circle").attr("r", 15);
$("#container").find("circle").attr("fill", "red");

只需手动找到对象并设置它的属性。

您也可以通过css设置fill 属性 like

circle{fill: rgb(255, 0, 0);}

但是css不能设置半径,所以我两种js方式都用了

http://jsfiddle.net/fwxbfu1u/6/

你可以使用plotOptions,见下面的link

plotOptions: {
            gauge: {
                pivot: {
                    radius: 10,
                    borderWidth: 1,
                    borderColor: 'gray',
                    backgroundColor: {
                        linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
                        stops: [
                            [0, 'white'],
                            [1, 'gray']
                        ]
                    }
                }
            }
        },

http://jsfiddle.net/fwxbfu1u/8/