tozymandias
tozymandias

Reputation: 21

how to remove fill under line from graph using angular-charts

I am fairly new to angular. Trying to use angular-charts for some data visualization. Charts.js lists an attribute "fill" for coloring below a line but I am not sure how to reference this in angular. Any suggestions?

Upvotes: 2

Views: 2200

Answers (2)

b_it_s
b_it_s

Reputation: 714

In the latest version of angular-chart (1.X), chartjs 2.x is used. In this version, you need to use

$scope.options = {
    elements: {
        line: {
            fill: false
        }
    }
}

Upvotes: 4

Altrouge Brunestud
Altrouge Brunestud

Reputation: 71

Ok I found that I've made a huge mistake. The master branch of angular-chart is based on version 1.x of chart.js, but document on chartjs.org is for verion 2.x.

https://github.com/chartjs/Chart.js/blob/v1.1.1/docs/01-Line-Chart.md

This is the correct line-chart option for angular-chart. So simply using

$scope.options = {
  datasetFill : false
}

is Ok.

Upvotes: 1

Related Questions