如何使用Highchart在气泡图中使用颜色轴? [英] How can i have color axis in bubble chart using Highchart?
本文介绍了如何使用Highchart在气泡图中使用颜色轴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要用[x,y,z]值使用bubble highchart来开发色轴,以供参考
I need to develop color axis using bubble highchart with [x, y, z] values , for reference https://developers.google.com/chart/interactive/docs/gallery/bubblechart#color-by-numbers
I need to develop above mentioned bubble chart which is developed in google chart to High chart [bubble] .
解决方案
Based on the answer from this topic - stepped-color-shading-in-highcharts-doughnut-chart.
Wrapping bubble's prototype:
var bubbleProto = Highcharts.seriesTypes.bubble.prototype;
bubbleProto.axisTypes = ['xAxis', 'yAxis', 'colorAxis'];
bubbleProto.optionalAxis = 'colorAxis';
bubbleProto.colorKey = 'y';
Highcharts.wrap(bubbleProto, 'translate', function(proceed) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
Highcharts.seriesTypes.heatmap.prototype.translateColors.call(this);
});
Live example and output
http://jsfiddle.net/4y3qgdmn/41/
这篇关于如何使用Highchart在气泡图中使用颜色轴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文