How to set options?

て烟熏妆下的殇ゞ 提交于 2019-12-25 08:29:59

问题


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


回答1:


import { Component } from '@angular/core';
declare var require: any;
const Highcharts = require('highcharts');
Highcharts.setOptions({ lang: { thousandsSep: ',' } });

export class AppComponent {
...



回答2:


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;
}


来源:https://stackoverflow.com/questions/41110997/how-to-set-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!