Search Posts

Category: charts

Dynamically set chart type with AngularJS and chart.js

I want to write an AngularJS component which uses a template and a controller to display a chart.js chart that has a dynamic type (bar, line, pie, …) I use angular-chart.js to combine angular and chart.js My template looks like this: <div class=”card”> <div class=”card-body”> <h4 class=”card-title”>{{$ctrl.name}}</h4> Type is set to: {{$ctrl.type ? $ctrl.type : ‘pie’}} <div id=”container” class=”container” style=”width:100%”> <div class=”panel-body”> <canvas id=”chart_test” class=”chart chart-{{$ctrl.type ? $ctrl.type : ‘pie’}}” chart-data=”data” chart-labels=”labels” chart-series=”series” chart-options=”options” chart-dataset-override=”datasetOverride”></canvas> […]

Google visualisation charts

I have a problem with position of my chart, I want to put chart a 100% width from begin to end. my code test.controller(‘testCtrl’, [‘$scope’, function ($scope) { console.log(‘test chart’); var data = google.visualization.arrayToDataTable([ [‘Minute’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’], [‘0 min’, 0.72, 0.64, 0.55, 0.47, 0.68, 0.39], [”, 0.62, 0.69, 0.65, 0.51, 0.66, 0.37], [’45 min’, 0.69, 0.51, 0.55, 0.43, 0.54, 0.44], [”, 0.79, 0.68, 0.70, 0.57, 0.59, 0.41], [’90 min’, 0.66, 0.71, […]