删除AngularCharts中的网格线

时间:2016-07-11 12:21:07

标签: angularjs chart.js angular-chart

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

控制器

 $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
          };     

Chart.html

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

2 个答案:

答案 0 :(得分:5)

您可以在下方应用以删除网格线。这对我有用。

## x is intended to be in latin1
x <- "fa\xE7ile"
Encoding(x)
Encoding(x) <- "latin1"
x
xx <- iconv(x, "latin1", "UTF-8")
Encoding(c(x, xx))
c(x, xx)
Encoding(xx) <- "bytes"
xx # will be encoded in hex
cat("xx = ", xx, "\n", sep = "")

感谢。

答案 1 :(得分:0)

问题在于html:

options="{showTooltips: false}"移至chart-options="options"

<canvas id="line" class="chart chart-line" data="datax2" labels="labelsx2" legend="true" series="seriesx2" chart-options="options"></canvas>