高分散散点图中的单个点颜色 [英] Individual point color in highcharts scatterplot

查看:180
本文介绍了高分散散点图中的单个点颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请尝试以下代码:

 < script src =http://code.highcharts.com/highcharts的.js>< /脚本> 

< div id =containerstyle =height:400px>< / div>

  $(function(){
var chart = new Highcharts.Chart({
chart:{
renderTo:'container',
type:'column'
},
series:[{
data:[194.1,95.6,{y:54.4,color:'#FF0000'}]
}]
});
});

或者在 jfiddle

HighCharts以红色显示最后一栏。现在,如果您将图表类型从列更改为散点图,您将看到HighCharts不会为最后一个标记添加颜色,但它的工具提示不会着色。

我该如何制作HighCharts为散点图中的特定点着色?

解决方案

设置fillColor,而不是(或者)颜色:

 系列:[{
data:[194.1,95.6,{y:54.4,fillColor:' #FF0000'}]
}]

http://jsfiddle.net/Uu9ck/1/


Please try the following code:

<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

and

$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'column'
        },
        series: [{
          data: [194.1, 95.6, {y:54.4,color:'#FF0000'}]
        }]
    });
});

or run it in jfiddle.

HighCharts colors the last bar in red. Now if you change the chart type from 'column' to 'scatter', you will see that HighCharts does not color the last marker but its tooltip.

How can I make HighCharts color a specific point in a scatterplot?

解决方案

Set the "fillColor", instead of (or as well as) the "color":

series: [{
  data: [194.1, 95.6, {y:54.4, fillColor:'#FF0000'}]
}]

http://jsfiddle.net/Uu9ck/1/

这篇关于高分散散点图中的单个点颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆