내 프로젝트에서 Google 차트를 사용 중입니다. 다음 코드를 사용하여 Google 분산 형 차트에서 셀 집합에 색을 지정해야합니다.채색 셀 Google 차트 - 분산 형 차트
나는 데이터 처리를 위해 google.visualization.arrayToDataTable
을 사용하고 있습니다.
다음
는<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
<script type="text/javascript">
google.charts.load('current', {
callback: function() {
var dataTable = new google.visualization.DataTable({
cols: [
{label: 'X', type: 'number'},
{label: 'Low', type: 'number'},
{label: 'High', type: 'number'},
{label: 'Y', type: 'number'}
],
rows: [
{c:[{v: 3}, {v: 3.5}, null, null]},
{c:[{v: 4}, {v: 5.5}, null, null]},
{c:[{v: 4}, {v: 5}, null, null]},
{c:[{v: 6.5}, {v: 7}, null, null]},
{c:[{v: 8}, {v: 12}, null, null]},
// begin cell color
{c:[{v: 10}, null, {v: 10}, {v: 10}]},
{c:[{v: 11}, null, {v: 10}, {v: 10}]},
{c:[{v: 20}, null, {v: 10}, {v: 10}]},
]
});
var options = {
legend: 'none',
hAxis: {
ticks: [0, 5, 10, 15, 20],
title: 'Age'
},
height: 400,
isStacked: true,
series: {
// low
1: {
color: 'transparent',
type: 'area',
visibleInLegend: false
},
// high
2: {
areaOpacity: 0.6,
color: '#A5D6A7',
type: 'area',
visibleInLegend: false
}
},
seriesType: 'scatter',
title: 'Age vs. Weight comparison',
vAxis: {
ticks: [0, 5, 10, 15, 20],
title: 'Weight'
}
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(dataTable, options);
},
packages:['corechart']
});
</script>
이
'ComboChart' _cell_ 색상을 설정하는 2 스택 영역 시리즈 - 하단 영역이 투명하게 될 것입니다 - [이 답변] (http://stackoverflow.com/a/39671447/5090771) _may_help ... – WhiteHat