公告
财富商城
积分规则
提问
发文
2019-07-26 07:49发布
贪生不怕死
I want to use gradient in below chart.
Please help me on this concern.
Thanks in advance.
Link : http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/gauge-activity/
You should be able to use small trick for adding gradient to your angular gauge. You can use yAxis.stops for adding color gradients to your chart:
yAxis: { min: 0, max: 100, lineWidth: 0, tickPositions: [], stops: [ [0.1, '#55BF3B'], // green [0.5, '#DDDF0D'], // yellow [0.9, '#DF5353'] // red ], },
Then you can add points between your axis min and your value, so they will have different colors depending on points value.
function(chart) { var y = this.series[0].data[0].y; for (var i = y; i >= 0; i = i - (y / 80)) { chart.addSeries({ data: [{ y: i, radius: '100%', innerRadius: '100%', }], stickyTracking: false, enableMouseTracking: false }, false) } chart.redraw(); Highcharts.each(chart.series, function(s) { s.update({ borderColor: s.data[0].color }, false); }); chart.redraw(); }
Here you can find an example how it can work: http://jsfiddle.net/5ajoegb9/1/
最多设置5个标签!
You should be able to use small trick for adding gradient to your angular gauge. You can use yAxis.stops for adding color gradients to your chart:
Then you can add points between your axis min and your value, so they will have different colors depending on points value.
Here you can find an example how it can work: http://jsfiddle.net/5ajoegb9/1/