I transmit data for plotting using the drop-down list. The code is written in jQuery. How to rewrite this code in Angular 1.5?
An example and all the code here https://plnkr.co/edit/NR7GKcyqdjJKBfWB5fTG?p=preview
html
<select id="test"> <option isabled selected value="">Choose options</option> <option value="kpi_2">Kpi 2</option> <option value="kpi_3">Kpi 3</option> js
var dataFee = { labels: [], datasets: [{ label: " ", data: [18, 16, 125, 65, 100, 71, 12], .... }], }; var ctx = $("#myChartLine").get(0).getContext("2d"); var myLineChart = new Chart(ctx, { type: "line", data: dataFee, }); $('#test').change(function(){ const val = $(this).val(); switch (val){ case 'kpi_2': var secondData = { label: " ", data: [1, 12, 115, 55, 90, 80, 22], ..... }; dataFee.datasets.push(secondData); myLineChart.update(); break; ... } });
angular? - Stepan Kasyanenko