在Highcharts散点图中的单个颜色 [英] individual color in highcharts scatterplot

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

问题描述

请尝试以下代码:

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

<div id="container" style="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会将最后一个栏以红色显示。现在如果你将'column'改为'scatter',你会看到HighCharts不会为最后一个标记,但它的工具提示着色。

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

如何让HighCharts颜色

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

推荐答案

设置fillColor,而不是color / p>

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/

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

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