Ng2-charts: Line Charts Option don't work

Created on 6 Feb 2017  路  7Comments  路  Source: valor-software/ng2-charts

Hi I am trying to do something very easy but with no success.
I am using version 1.5.0 and I have a line charts where I don't want the fill under the line so I put fill option to false but nothing happen and the same anomaly happens with lineTension option, is it my mistake?

public lineChartOptions: any = {
        fill: false,        
        responsive: true,
        lineTension: 1
    };

Most helpful comment

This is the working sample:

<canvas baseChart 
    [datasets]="[{ data: [65, 59, 80, 81, 56, 55, 40], fill: false, lineTension: 0 }]"
      [labels]="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
      [options]="{}"
      [chartType]="'line'"
    >
</canvas>

All 7 comments

Try to use lineChartColors to do this

  public lineChartColors: any = {
      backgroundColor: 'rgba(0, 0, 0, 0)'
      ...
    }

Thanks to your reply, but this doesn't work form me because I have a multiline graph and I want to have single colored line, with the solution you proposed I get a gray scale results :(

Could you provide plinker with your problem?

Based on the plunkr in the Readme:
http://plnkr.co/edit/ECC8hEGh8Edi7VSdnz3z?p=preview

In this case, adding either tension: 0 or lineTension:0has no effect on the curve interpolation.

Well, found the answer to that: the option is to be defined in the dataset, rather than the options object:

http://plnkr.co/edit/D9rMqkrCjDpb2S10Dq4P?p=preview

Thanks, it resolved the problem!

This is the working sample:

<canvas baseChart 
    [datasets]="[{ data: [65, 59, 80, 81, 56, 55, 40], fill: false, lineTension: 0 }]"
      [labels]="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
      [options]="{}"
      [chartType]="'line'"
    >
</canvas>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Adwind picture Adwind  路  3Comments

tssobe picture tssobe  路  4Comments

egervari picture egervari  路  4Comments

Maistho picture Maistho  路  3Comments

shyamal890 picture shyamal890  路  4Comments