boxplot シリーズの塗りつぶしの色を設定し、特定の状態 (ホバーして選択) でその色をオーバーライドできるようにしたいと考えています。
問題は、デフォルトのfillColorを設定するたびに、ホバーと選択の状態が機能しなくなり、デフォルトのfillColorのみが使用されることです。
デフォルトのfillcolorが設定されていない場合、状態のfillColorsも機能しません(すでに機能するように設定されているfillColorプロパティに依存しているためだと思います)。
ただし、デフォルトのfillColorを「#fsdfrw4jh432」のような無効な設定に設定すると、「まあまあ」機能します。つまり、状態が機能するようになりました。
この jsfiddle を参照して、私の意味を確認してください: http://jsfiddle.net/wiseguy205/b3CuF/1/
そのjsfiddleからわかるように、ホバーと選択の状態は機能しますが、無効なカラーコードであるため、塗りつぶしの色は黒で始まります。カラーコードを正しい色に変更すると、状態が機能しなくなります。
私が間違っていることはありますか?
ところでjsfiddleコードは次のとおりです。
$(function () {
$('#container').highcharts({
chart: {
type: 'boxplot'
},
title: {
text: 'Highcharts Box Plot Example'
},
legend: {
enabled: false
},
plotOptions: {
series: {
allowPointSelect: true,
states:{
hover: {
enabled: true,
lineWidth: 5,
fillColor: '#0F0'
},
select: {
fillColor: '#F00',
enabled: 'true'
}
},
fillColor: '#00dddddF',
}
},
xAxis: {
categories: ['1', '2', '3', '4', '5'],
title: {
text: 'Experiment No.'
}
},
yAxis: {
title: {
text: 'Observations'
},
plotLines: [{
value: 932,
color: 'red',
width: 1,
label: {
text: 'Theoretical mean: 932',
align: 'center',
style: {
color: 'gray'
}
}
}]
},
series: [{
name: 'Observations',
data: [
[760, 801, 848, 895, 965],
[733, 853, 939, 980, 1080],
[714, 762, 817, 870, 918],
[724, 802, 806, 871, 950],
[834, 836, 864, 882, 910]
],
tooltip: {
headerFormat: '<em>Experiment No {point.key}</em><br/>'
}
}, {
name: 'Outlier',
color: Highcharts.getOptions().colors[0],
type: 'scatter',
data: [ // x, y positions where 0 is the first category
[0, 644],
[4, 718],
[4, 951],
[4, 969]
],
marker: {
fillColor: 'white',
lineWidth: 1,
lineColor: Highcharts.getOptions().colors[0]
},
tooltip: {
pointFormat: 'Observation: {point.y}'
}
}]
});
// the button action
$('#button').click(function() {
var selectedPoints = $('#container').highcharts().getSelectedPoints();
alert ('You selected '+ selectedPoints.length +' points');
});
});