简体   繁体   English

Heatmap.js只是想要一个红色斑点,而不在数据点上使用多种颜色

[英]Heatmap.js Just want a red blob not multiple colours on the datapoint

I have created a heatmap and I just want my data point to be one colour instead of multiple colors like the standard one is, I'm not sure how to change the configuration of all the data points to do this. 我已经创建了一个热图,我只是希望我的数据点是一种颜色,而不是标准颜色那样的多种颜色,我不确定如何更改所有数据点的配置来做到这一点。

I basically just want the colour in the middle to be the colour of the entire circle. 我基本上只是希望中间的颜色是整个圆圈的颜色。

https://www.patrick-wied.at/static/heatmapjs/example-heatmap-googlemaps.html https://www.patrick-wied.at/static/heatmapjs/example-heatmap-googlemaps.html

On that website you will see an example of a heatmap and the data points all have blue bits around the outside I literally just want to make my points so they are just the colour in the middle of the data point. 在该网站上,您将看到一个热图的示例,并且数据点的外部都带有蓝色位,我实际上只是想标注点,因此它们只是数据点中间的颜色。

For example the point in Florida I just want that entire circle to be red because it is red in the middle, instead of having the blue/yellow/green bits. 例如,在佛罗里达州,我只希望整个圆圈为红色,因为它的中间为红色,而不是蓝色/黄色/绿色。

You just need to define the gradient in the heatmap and also set the blur value to cero: 您只需要在heatmap定义渐变并将模糊值设置为0:

For example: 例如:

var config = {
  container: document.querySelector('.heatmap'),
  blur: 0,
  gradient: {
    '1': 'red',
    '0': 'white',
  },
};
var heatmapInstance = h337.create(config);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM