Angular D3 Graph
Component for rendering a line graph or bar graph.
Usage
npm install angular-d3-graph
Import it into app.module.ts (or whichever module you want to use)
;
Add it into your component template:
Inputs
Data
Data can be formatted in two ways, one for line graphs and one for bar graphs.
Line Graph:
Bar Graph:
Settings
You can provide your own settings object overrides to the settings input on the component.
Default settings are as follows:
;
x1 and x2
The x1 and x2 inputs are used for adjusting the view of the line graph to show from x1 to x2.
Outputs
activeValuesChanged
$event
contains an array of all of the lines, or the selected bar and their x / y values based on the mouse position on hover, the touch location, or the positon navigated to by keyboard.