Angular-highcharts-bar-negative
提供:Dev Guides
負の値を持つ棒グラフ
以下は、負の値を持つ棒グラフの例です。
link:/angular_highcharts/angular_highcharts_configuration_syntax [Highcharts構成構文]の章でチャートを描画するために使用される構成についてはすでに見ました。 次に、負の値を持つ基本的な棒グラフの例を見てみましょう。
例
*_app.component.ts_*
import { Component } from '@angular/core';
import * as Highcharts from 'highcharts';
@Component({
selector: 'app-root',
templateUrl: './app.componentl',
styleUrls: ['./app.component.css']
})
export class AppComponent {
highcharts = Highcharts;
chartOptions = {
chart: {
type: 'bar'
},
title: {
text: 'Bar 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]
}
]
};
}
結果
結果を確認します。