Home Forums Chart Support Charts with drop down button to filter Reply To: Charts with drop down button to filter



To modify a chart based on dropdown selection you need to update the chart options / data according to the options selected from the dropdown list using the ngModelChange event. Please check the code snippet below –


<select [(ngModel)]="selectedValue" (ngModelChange)='onChange($event)'>
  <option *ngFor="let option of options" [value]="option.id">


  let dps = this.jsonData[val]; 
  this.chart.options.data[0].dataPoints = dps;

Also, kindly take a look at this StackBlitz for a working example.

Chart from Dropdown list in Angular

Indranil Deo
Team CanvasJS