How to set options?

2019-09-15 08:51发布

After angular2 updated, they don't import Highcharts from angular2-highcharts anymore. How can I set options? Plunker

I want to add

Highcharts.setOptions({ lang: { thousandsSep: ',' } });

Thanks

2条回答
劫难
2楼-- · 2019-09-15 09:18
import { Component } from '@angular/core';
declare var require: any;
const Highcharts = require('highcharts');
Highcharts.setOptions({ lang: { thousandsSep: ',' } });

export class AppComponent {
...
查看更多
Explosion°爆炸
3楼-- · 2019-09-15 09:30

Just add it to the literal inside the constructor: (inside app/main.ts) in the plunker.

class AppComponent {
  constructor() { 
    this.options = {
      title : { text : 'simple chart' },
      series: [{
        data: [29.9, 71.5, 106.4, 129]
      }],
      lang: { thousandsSep: ',' }
    };
  }
  options: Object;
}
查看更多
登录 后发表回答