gpt4 book ai didi

angularjs - 删除 AngularCharts 中的网格线

转载 作者:行者123 更新时间:2023-12-05 00:55:17 25 4
gpt4 key购买 nike

我正在使用 AngularCharts这是 Chart.js 的 AgnularJS 包装器。我想从我的图表中删除所有网格线,所以只有实际的折线图。但是网格并没有被移除。

Controller

 $scope.labelsx2 = [" ", " ", " ", " Time ago ", " ", " ", " "];
$scope.seriesx2 = [' '];
$scope.datax2 = [
[65, 59, 80, 81, 56, 55, 40]
];
$scope.options = {
scaleShowGridLines : false
};


$scope.labelsx2 = [" ", " ", " ", " Time ago ", " ", " ", " "];
$scope.seriesx2 = [' '];
$scope.datax2 = [
[65, 59, 80, 81, 56, 55, 40]
];
$scope.options = {
scaleShowGridLines : false
};

图表.html
<canvas id="line" class="chart chart-line" data="datax2" labels="labelsx2" legend="true" series="seriesx2" options="{showTooltips: false}"></canvas>

最佳答案

您可以应用以下选项来删除网格线。这对我有用。

$scope.options = {
scales: {
xAxes: [{
gridLines: {
display: false
}
}],
yAxes: [{
gridLines: {
display: false
}
}]
}
};

谢谢。

关于angularjs - 删除 AngularCharts 中的网格线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38306785/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com