Line + Bar Chart
Introduction
You can check a running example of this Line + Bar Chart here.
All chart parameters for the Line + Bar Chart can be checked in the API tab.
Basic Example
HTML
<o-chart type="linePlusBarWithFocusChart" entity="EMovementsGrouped" x-axis="DATE_" y-axis="MOVEMENT;BALANCE" x-data-type="time" [chart-parameters]="chartParameters" chart-height="500"></o-chart>
TS
import { Component } from '@angular/core';
import { LinePlusBarFocusChartConfiguration } from 'ontimize-web-ngx-charts';
@Component({
selector: 'app-lineplusbar',
templateUrl: './lineplusbar.component.html'
})
export class LineplusbarComponent {
chartParameters: LinePlusBarFocusChartConfiguration;
constructor() {
this.chartParameters = new LinePlusBarFocusChartConfiguration();
this.chartParameters.bars = [true, false];
}
}
Custom Configuration Example
HTML
<o-chart type="linePlusBarWithFocusChart" entity="EMovementsGrouped" x-axis="DATE_" y-axis="MOVEMENT;BALANCE" x-data-type="time" [chart-parameters]="chartParameters" chart-height="500"></o-chart>
TS
import { Component } from '@angular/core';
import { LinePlusBarFocusChartConfiguration } from 'ontimize-web-ngx-charts';
@Component({
selector: 'app-lineplusbar',
templateUrl: './lineplusbar.component.html'
})
export class LineplusbarComponent {
chartParameters: LinePlusBarFocusChartConfiguration;
constructor() {
this.chartParameters = new LinePlusBarFocusChartConfiguration();
this.chartParameters.bars = [ true, false];
this.chartParameters.to_zero = [true, false];
this.chartParameters.to_previusValue = [false, true];
this.chartParameters.colors = ["blue", "red"]
}
}
Line + Bar 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 | Since | Description | Default |
---|---|---|---|
bars boolean |
|
Parameter for select chart with bars or line |
|
color string[] |
|
Colors to use for the different data. |
|
duration number |
|
Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value. |
500 |
focusEnable boolean |
|
Enable or disable focus. |
true |
focusShowAxisX boolean |
|
On focus show X axis |
true |
focusShowAxisY boolean |
|
On focus show Y axis |
false |
forceX array |
|
List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn’t override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option. |
|
forceY array |
|
List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn’t override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option. |
|
interactive boolean |
|
A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options. |
true |
isArea |
|
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. |
|
margin object |
|
Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts. |
|
showLabels boolean |
|
Whether to display the legend or not |
|
showLegend boolean |
|
Whether to display the legend or not |
true |
switchYAxisOrder boolean |
|
If two Y axis are used, this option changes the order of both axis. |
false |
to_previousValue boolean[] |
|
Parameters for create equispaced points in chart to_zero is priority in the case of two parameters are activated |
|
to_zero boolean[] |
|
Parameters for create equispaced points in chart to_zero is priority in the case of two parameters are activated |
|
Inherited outputs
-
from ChartComponent:
- onDoubleTap
- onPinch
- onPress
- onRotate
- onSwipe
- onTap