1.3.2 • Published 5 years ago

ng-interpolated-charts v1.3.2

Weekly downloads
12
License
-
Repository
github
Last release
5 years ago

Angular Interpolated Charts

Angular 2 component for interpolated-charts

Installation

  1. Install package with npm
npm install ng-interpolated-charts interpolated-charts --save
  1. Import and register module
import { InterpolatedChartModule } from 'ng-interpolated-charts';

@NgModule({
  imports: [
    InterpolatedChartModule
  ]
})

Usage

Inside template:

<!-- line chart -->
<interpolated-chart
  [data]="chartData"
  [yAxisValueFormat]="yAxisValueFormat"
  [valueFormatter]="valueFormatter">
</interpolated-chart>

<!-- stack bar -->
<interpolated-stack-bar
  [data]="stackBarData">
</interpolated-stack-bar>

Inside component:

chartData = [
  {
    name: 'Minsk',
    data: [
      { 'date': new Date('2015-01-01T00:00:00'), 'value': 20 },
      { 'date': new Date('2015-01-02T00:00:00'), 'value': 16 },
      { 'date': new Date('2015-01-03T00:00:00'), 'value': 21 }
    ]
  }
];
yAxisValueFormat = value => `${value}°C`;
valueFormatter = ({interpolatedValue}) => `${interpolatedValue.toFixed(1)}°C`;

stackBarData = [
  { date: new Date('2015-01-01T00:00:00'), color: 'red', name: 'dry', value: 1 },
  { date: new Date('2015-01-02T00:00:00'), color: 'red', name: 'dry', value: 1 },
  { date: new Date('2015-01-03T00:00:00'), color: 'yellow', name: 'wet', value: 2 },
  { date: new Date('2015-01-04T00:00:00'), color: 'yellow', name: 'wet', value: 2 },

  { date: new Date('2015-01-06T00:00:00'), color: 'blue', name: 'snow', value: 3 },
  { date: new Date('2015-01-07T00:00:00'), color: 'blue', name: 'snow', value: 3 },
  { date: new Date('2015-01-11T00:00:00'), color: 'green', name: 'ice', value: 4 },
  { date: new Date('2015-01-12T00:00:00'), color: 'green', name: 'ice', value: 4 },
  { date: new Date('2015-01-13T00:00:00'), color: 'green', name: 'ice', value: 4 }
];

Documentation

Chart documentation here

Component inputs:

Line Chart config

Binding nameConfig Name
widthwidth
heightheight
marginmargin
maxTimeRangeDifferenceToDrawmaxTimeRangeDifferenceToDraw
xAxisTimeFormatxAxisTimeFormat
yAxisValueFormatyAxisValueFormat
curvecurve
interpolationMaxIterationCountinterpolationMaxIterationCount
interpolationAccuracyinterpolationAccuracy
mouseMoveTimeTresholdmouseMoveTimeTreshold
xAxisDateFromxAxisDateFrom
xAxisDateToxAxisDateTo

Mouse events:

Binding name
onMouseEnter
onMouseLeave
onMouseMove
onMouseClick

Stack Bar config

Binding nameConfig Name
widthwidth
heightheight
marginmargin
backgroundColorbackgroundColor
maxTimeRangeDifferenceToDrawmaxTimeRangeDifferenceToDraw
xAxisTimeFormatxAxisTimeFormat
mouseMoveTimeTresholdmouseMoveTimeTreshold
xAxisDateFromxAxisDateFrom
xAxisDateToxAxisDateTo

Mouse events:

Binding name
onMouseEnter
onMouseLeave
onMouseMove
onMouseClick

Marker plugin config

Binding nameConfig Name
cxcx
cycy
radiusradius
fillfill
strokestroke
strokeWidthstrokeWidth
markerSortsort

Tooltip plugin config

Binding nameConfig Name
tooltipWidthtooltipWidth
horizontalMouseMarginhorizontalMouseMargin
verticalBorderMarginverticalBorderMargin
headerFormatterheaderFormatter
topicFormattertopicFormatter
valueFormattervalueFormatter
tooltipSortsort

Development

Library creation docs

Library location in project - projects/ng-interpolated-charts.

Build library (with ng-packagr to Angular Package Format): ng build ng-interpolated-charts

Publish to npm: npm publish projects/ng-interpolated-charts

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago