admin管理员组文章数量:1328037
Please try the following code:
<script src=".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?
Please try the following code:
<script src="http://code.highcharts./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?
Share Improve this question edited Sep 28, 2017 at 16:40 Dan Dascalescu 152k64 gold badges333 silver badges420 bronze badges asked Jan 10, 2013 at 0:01 tictic 4,19915 gold badges51 silver badges87 bronze badges2 Answers
Reset to default 4Set the "fillColor", instead of (or as well as) the "color":
series: [{
data: [194.1, 95.6, {y:54.4, fillColor:'#FF0000'}]
}]
http://jsfiddle/Uu9ck/1/
You don't need to set fillColor
. color
works, just like in your example, if you set the series type to scatter
(as opposed to the chart type):
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
},
series: [{
type: 'scatter', // <- this
data: [194.1, 95.6, { y:54.4, color:'#FF0000' }]
}]
});
});
Here's the fiddle.
本文标签: javascriptIndividual point color in highcharts scatterplotStack Overflow
版权声明:本文标题:javascript - Individual point color in highcharts scatterplot - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742242319a2438910.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论