gpt4 book ai didi

javascript - Highcharts 热图不适用于大范围的数据值(最小值 : 0, 最大值 : 5, 000,000)

转载 作者:行者123 更新时间:2023-11-28 19:05:38 30 4
gpt4 key购买 nike

我尝试使用 Highcharts 绘制热图 (50 x 100)。我注意到当我的数据值范围很广(从 0 到 5,000,000)时,图表无法正确显示。但是,如果我将数据值更改为更小的范围(例如从 0 到 1),图表似乎没问题。

    $('#heatmap').highcharts({

chart: {
type: 'heatmap',
marginTop: 40,
marginBottom: 40,
zoomType: 'xy'
},

credits: {
enabled: false
},

plotOptions: {
series: {
events: {
click: function (event) {
alert('event!');
}
}
}
},


title: {
text: 'Sample title yo'
},

xAxis: {
categories: xCategories,
title: null
},

yAxis: {
categories: yCategories,
title: null
},

colorAxis: {
min: min,
max: maxv,
minColor: '#FFFFFF',
maxColor: Highcharts.getOptions().colors[0]
},

legend: {
align: 'right',
layout: 'vertical',
margin: 0,
verticalAlign: 'top',
y: 25,
symbolHeight: 320
},

tooltip: {
formatter: function () {
return '<b>' + this.series.xAxis.categories[this.point.x] + '</b> sold <br><b>' + this.point.value + '</b> items on <br><b>' + this.series.yAxis.categories[this.point.y] + '</b>';
}
},

series: [{
name: 'Lorem ipsum',
borderWidth: 1,
data: data,
dataLabels: {
enabled: false,
color: 'black',
style: {
textShadow: 'none',
HcTextStroke: null
}
}
}]

});

这是我的 fiddle :http://jsfiddle.net/bpp8ahyc/4/

我可以做些什么来显示大值吗?

最佳答案

您需要增加 turboThreshold 的值或设置为无限制(按 0)。

plotOptions: {
series: {
turboThreshold:0
}
}

示例:http://jsfiddle.net/bpp8ahyc/5/

关于javascript - Highcharts 热图不适用于大范围的数据值(最小值 : 0, 最大值 : 5, 000,000),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31740888/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com