Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 1.12 KB

File metadata and controls

25 lines (21 loc) · 1.12 KB

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.