Daisy
Daisy

Reputation: 89

How to set options?

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

Upvotes: 0

Views: 1764

Answers (2)

Daisy
Daisy

Reputation: 89

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

export class AppComponent {
...

Upvotes: 3

williamsandonz
williamsandonz

Reputation: 16440

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

Upvotes: 0

Related Questions