1.1.2 • Published 1 year ago

ngx-chart3 v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Chart3

Library for build charts in angular app.

Demo

vercel: https://chart3-demo.vercel.app/

Installation

npm install ngx-chart3
import { NgxChart3Module } from 'ngx-chart3';

@NgModule({
    imports: [
        NgxChart3Module
    ]
})

Add chart in template and set chart settings.

Line and scatter plot chart

<mixed-chart3></mixed-chart3>

Bar chart

<bar-chart3></bar-chart3>

Update chart

Use async pipe for update chart data and chart size.

<mixed-chart3
    [chartData]="data$ | async"
    [width]="chartWidth$ | async"
    [height]="chartHeight$ | async"
></mixed-chart3>

Version

Work with angular 15

API Documentation

Inputs for all charts

ParametersValueSettings example
svgIdSVG id for chart (If not set, it will generate a random ID)'my-svg-id'
widthWidth of svg container600
heightHeight of svg container800
marginsMargins of svg container{left: 30, right: 30, bottom: 30, top: 30}
fontSizeFont size of axes15

Inputs for line and scatter plot charts

ParametersValueSettings example
chartDataArray of data[{lineName: 'line', lineData: {x: 1, 2, 3, y: 5, 2, 9}, color: 'green', opacity: 0.4, strokeWidth: 6}, {dotName: 'dots', dotData: {x: 1, 2, 3, y: 4, 7, 9}, radious: 9}]
rangeSet range for chart{x: 0, 10, y: 0, 10}
selectRangeAdd tool for select range of chart (Does't work with zoom)false
zoomAdd tool for zoom chart (Does't work with selectRange)true
cursorAdd crosshair cursor and show current position of ittrue
axisNameAdd names of axis{x: '', y: ''}
gridSizeFrequency of chart grid5

Inputs for bar charts

ParametersValueSettings example
chartDataArray of data (colors: name of color, percent of the column)[{lable: 'bar 1',y: 7,color: '#EB455F'},{lable: 'bar 2',y: 5,colors: ['#FCFFE7', 25, '#EB455F', 25, '#BAD7E9', 25, '#2B3467', 25]},]
axisNameAdd names of axis{x: '', y: ''}
rotateRotate bar name45
barPaddingSpacing between columns (0 - 1)0.2