Angular Highcharts:负值柱形图(Column Chart with negative values)
让我们看一个带有负值的基本柱形图的例子。
例子
app.component.ts
import { Component } from '@angular/core'; import * as Highcharts from 'highcharts'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { highcharts = Highcharts; chartOptions = { chart: { type: 'column' }, title: { text: 'Column chart with negative values' }, xAxis:{ categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'] }, series: [ { name: 'John', data: [5, 3, 4, 7, 2] }, { name: 'Jane', data: [2, -2, -3, 2, 1] }, { name: 'Joe', data: [3, 4, 4, -2, 5] } ] }; }
结果