0
Canvas JS 차트가 있는데 값이 0이면 레이블을 숨기고 싶습니다. 내 데이터 포인트 중 2 개가 0이 아닙니다. 내 자바 스크립트는 다음과 같습니다 자바 스크립트의CanvasJS 차트 용 라벨 숨기기?
var chart = new CanvasJS.Chart("chartContainer",
{
title:{
text: ""
},
legend: {
maxWidth: 350,
itemWidth: 120
},
data: [
{
type: "pie",
showInLegend: true,
toolTipContent: "${y} - #percent %",
dataPoints: [
{ y: debt, indexLabel: "Debt Payments" },
{ y: housing, indexLabel: "Housing" },
{ y: utilities, indexLabel: "Utilities" },
{ y: foodandsupplies, indexLabel: "Food and Supplies"},
{ y: transportation, indexLabel: "Transportation" },
{ y: health, indexLabel: "Health"},
{ y: otherDebts, indexLabel: "Other payments"}
]
}
]
});
chart.render();
결과는 다음과 같습니다
내가이 어떤 도움을 주셔서 감사합니다. 감사!