To use the ChartEditor class, inject GoogleChartEditor in your component then call openDialog():

  constructor(private chartEditor: GoogleChartEditor) { }

  public editChart() {
    this.chartEditor.openDialog(this.columnChart)
                    .then((wrapper: GoogleChartWrapper) => {
                      console.log('dialog OK');
                      console.log('new chart type: ', wrapper.getChartType());
                    })
                    .catch(() => console.log('dialog cancelled'));
  }

You can pass either a GoogleChartInterface or a GoogleChartComponent to openDialog(). The metod returns a Promise for a ChartWrapper that can be used to query the newly set chart properties (see reference documentation). The new chart type and options can also be recovered from the component's data property (GoogleChartInterface) which gets updated automatically.

results matching ""

    No results matching ""