我使用的是Highcharts,
我希望有一个类似于地图的图例,而不是默认的折线图的图例,仅针对特定的行。
例如,使用此图例
legend: {
layout: 'horizontal',
borderWidth: 0,
backgroundColor: 'rgba(255,255,255,0.85)',
floating: true,
verticalAlign: 'top',
y: 25
},
而不是
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
在这个例子中,有东京"详细数字。
任何想法?
答案 0 :(得分:0)
一般情况下,它不受支持,但您可以尝试将这些功能从地图添加到标准图表:http://jsfiddle.net/w9nuha8n/
(function (H) {
// add colorAxis
H.seriesTypes.line.prototype.axisTypes = ['xAxis', 'yAxis', 'colorAxis'];
H.seriesTypes.line.prototype.optionalAxis = 'colorAxis';
// draw points and add setting colors
H.wrap(H.seriesTypes.line.prototype, "translate", function (p) {
p.call(this);
H.seriesTypes.heatmap.prototype.translateColors.call(this);
});
// copy method from heatmap for color mixin
H.seriesTypes.line.prototype.translateColors = H.seriesTypes.heatmap.prototype.translateColors;
// use "y" to calculate color
H.seriesTypes.line.prototype.colorKey = 'y';
})(Highcharts);