Controller
$scope.grafico = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
series: ['Series A', 'Series B'],
data: [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
]
}
$scope.tipoGrafico = "";
HTML
<div class="bloco grafico">
<canvas
class="chart {{tipoGrafico}}"
chart-data="grafico.data"
chart-labels="grafico.labels"
chart-series="grafico.series"
chart-legend="false">
</canvas>
</div>
<label>
Tipo de Gráfico
<select ng-model="tipoGrafico">
<option value="chart-line">Linha</option>
<option value="chart-bar">Barra</option>
<option value="chart-pie">Pizza</option>
</select>
</label>
I'm new to programming angular so any criticism of the code or suggestion of some other way of doing what I want is always welcome! Thank you in advance.