I want to show the data of only one axis when selected through dropdown for my chart js graph. Here's my html and ts code for that. Here (this.a and this.b) has an array from api. <select class="dropdown" name="chartType" id="chartType" (change)="chartType($any($event.target).data)"> Select Axis A B
this.chart = new Chart('canvas', {
type: 'line',
data: {
labels: this.a,
datasets: [{
label: 'B',
data: this.b,
borderWidth: 3,
backgroundColor: 'black',
borderColor: 'red'
},
{
label: 'A',
data: this.a,
borderWidth: 3,
backgroundColor: 'green',
borderColor: 'yellow'
}