Line Chart
Introduction
You can check a running example of this Line Chart here.
All chart parameters for the Line Chart can be checked in the API tab.
Basic Example
HTML
<o-chart type="line" x-label="Time" y-label="Amount (€)" entity="EMovements" x-axis="DATE_" y-axis="MOVEMENT" x-data-type="time"></o-chart>
Custom Configuration Example
HTML
<o-chart #lineChartBasic type="line" x-label="Time" y-label="Amount (€)" entity="EMovements" x-axis="DATE_" y-axis="MOVEMENT" [chart-parameters]="chartParameters" x-data-type="time"></o-chart>
TS
import { Component, ViewChild } from '@angular/core';
import { OChartComponent, LineChartConfiguration, ChartService } from 'ontimize-web-ngx-charts';
@Component({
selector: 'line',
templateUrl: './line.component.html'
})
export class LineComponent {
chartParameters: LineChartConfiguration;
constructor() {
this.chartParameters = new LineChartConfiguration();
this.chartParameters.isArea = [true];
this.chartParameters.interactive = false;
this.chartParameters.useInteractiveGuideline = false;
}
}
Line Chart
Directive: o-chart
Inherited inputs
-
from OChartComponent:
- chart-height
- chart-parameters
- chart-width
- data
- type
- x-axis
- x-data-type
- x-label
- y-axis
- y-data-type
- y-label
Chart Parameters
Name | Description | Default |
---|---|---|
classed string |
Set class |
|
color array |
Colors to use for the different data. |
|
duration number |
Duration in ms |
500 |
focusEnable boolean |
Enable / Disable focus |
false |
focusShowAxisX boolean |
Show Axis X on focus |
false |
interactive boolean |
A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options. |
true |
isArea boolean |
Function to define if a line is a normal line or if it fills in the area. Notice the default gets the value from the line’s definition in data. If a non-function is given, it the value is used for all lines. |
|
legendPosition string |
Position of the legend (top, right, bottom) |
top |
rightAlignYAxis boolean |
When only one Y axis is used, this puts the Y axis on the right side instead of the left. |
false |
showLegend boolean |
Whether to display the legend or not |
true |
showXAxis boolean |
Show or not X Axis |
true |
showYAxis boolean |
Show or not Y Axis |
true |
strokeWidth number |
Stroke width in pixels |
|
useInteractiveGuideline boolean |
Sets the chart to use a guideline and floating tooltip instead of requiring the user to hover over specific hotspots. Turning this on will set the ‘interactive’ and ‘useVoronoi’ options to false to avoid conflicting. |
true |
Inherited outputs
-
from ChartComponent:
- onDoubleTap
- onPinch
- onPress
- onRotate
- onSwipe
- onTap