여기 내 코드입니다. x와 y 축 스케일 모두에서 초기 값을 "0"으로 설정해야합니다. 최신 버전의 비늘 옵션을 사용해 보았습니다.chartjs에서 시작 값을 "0"으로 설정하는 방법은 무엇입니까?
graphOptions = {
///Boolean - Whether grid lines are shown across the chart
scaleShowGridLines: false,
tooltipTitleTemplate: "<%= label%>",
//String - Colour of the grid lines
scaleGridLineColor: "rgba(0,0,0,.05)",
//Number - Width of the grid lines
scaleGridLineWidth: 1,
//Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
//Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines: true,
//Boolean - Whether the line is curved between points
bezierCurve: true,
//Number - Tension of the bezier curve between points
bezierCurveTension: 0.4,
//Boolean - Whether to show a dot for each point
pointDot: true,
//Number - Radius of each point dot in pixels
pointDotRadius: 4,
//Number - Pixel width of point dot stroke
pointDotStrokeWidth: 1,
pointHitDetectionRadius: 20,
datasetStroke: true,
datasetStrokeWidth: 2,
datasetFill: true,
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"
};
var LineChart = new Chart(ctx).Line(graphData, graphOptions);
}
고맙습니다. xnakos. 그것은 나를 위해 작동 –
@SuganthanRaj 여러분 환영합니다! Chart.js 2.0의 문서를 참조하십시오. 1.0 버전에서 많은 변화가 있었고 온라인 버전의 대부분은 1.0 버전에 적용됩니다. ;) – xnakos
@SuganthanRaj 예를 들어, 'scaleShowVerticalLines'는 2.0에서는 유효하지 않습니다. 또는 툴팁 템플릿. 옵션은 일반적으로 2.0에서 계층 적 접근 방식을 따릅니다. – xnakos