Ngx-charts: Add spline interpolation option for lines and areas

Created on 9 Oct 2016  路  5Comments  路  Source: swimlane/ngx-charts

Add an input property to line and area charts that specifies the interpolation algorithm used to generate the paths.

The available values would be 'linear', 'cardinal', and 'monotone'.

Example:
http://bl.ocks.org/mbostock/4342190

Enhancement Easy Backlog

Most helpful comment

I have understood how it works 馃挴

to get Linear type, here is the solution :
component.html

<ngx-charts-polar-chart
  [view]="view]"
  [scheme]="colorScheme"
  [results]="_Data"
  [legend]="Legend"
  [xAxis]="XAxis"
  [curve]="linearCurve"
>
</ngx-charts-polar-chart>

component.ts

import * as shape from 'd3-shape';

  linearCurve= shape.curveLinearClosed;

and you will get linear curve.

Hope you find this solution helpful 馃憤

Here are different inbuilt functions :

image

>>reference<<

All 5 comments

Added an input called curve to the line and all area charts. The type is one of d3's curve functions:
https://github.com/d3/d3-shape#curves

[curve]="d3.shape.curveLinear"

hi,

can you please provide a working plunker for this?

i found myself struggling with implementing this curve.

thanks a lot.

+1 don't understand exactly how to make it work?

I guess we have to put our own curve function or import the d3 library?

Thanks!

I have understood how it works 馃挴

to get Linear type, here is the solution :
component.html

<ngx-charts-polar-chart
  [view]="view]"
  [scheme]="colorScheme"
  [results]="_Data"
  [legend]="Legend"
  [xAxis]="XAxis"
  [curve]="linearCurve"
>
</ngx-charts-polar-chart>

component.ts

import * as shape from 'd3-shape';

  linearCurve= shape.curveLinearClosed;

and you will get linear curve.

Hope you find this solution helpful 馃憤

Here are different inbuilt functions :

image

>>reference<<

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NashIlli picture NashIlli  路  3Comments

ronybarbosa picture ronybarbosa  路  3Comments

ianfdk picture ianfdk  路  3Comments

tobigit picture tobigit  路  4Comments

lokeshdaiya picture lokeshdaiya  路  3Comments