var chartLabels = [];
var chartData = [];
$.getJSON("/stock/materialList?fno="+fno, function(data) {
$.each(data, function(inx, obj) {
chartLabels.push(obj.mname);
chartData.push(obj.mamount);
});
removeChart();
createChart();
});
var lineChartData = {
labels : chartLabels,
datasets : [ {
label : "Àç°í",
fillColor: "rgba(186,236,255,0.2)",
strokeColor: "rgba(23,120,255,0.5)",
data : chartData
}
]
}
jsonÇü½ÄÀ¸·Î ¹ÞÀº chartData¿¡¼
ƯÁ¤ °ªµéÀÌ 20%ÀÌÇϸé fillColor¸¦ º¯°æÇϵµ·Ï ÇÏ°í½ÍÀºµ¥
µµ¹«Áö °¨ÀÌ ¾ÈÀâÈü´Ï´Ù.
¾î¶»°Ô ÇؾßÇÒ±î¿ä?
|
if(obj.ƯÁ¤°ª < 20%){
chartData.datasets[inx].fillColor=\"º¯°æ»ö\";
}