score:2
Accepted answer
Ideally you should do otherwise and call the javascript methods to draw chart via angularJs
.controller('DashboardController', function ($scope) {
$scope.getChartLabels = function() {
return ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"];
}
$scope.getChartData = function() {
return [12, 19, 3, 5, 2, 3];
}
drawCharts($scope.getChartLabels,$scope.getChartData);
}
function drawCharts(d1,d2){
// draw charts here.
}
Source: stackoverflow.com
Related Query
- How to write with good practice?
- How to write better code in es6 for formatting an object with array values
- how to write labels along with data on top and bottom of each stack in bar chart
- How write the labels of the data inside a Doughnut Chart made with Chart.js?
- How to run Chart.js samples using source code
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- How to prevent first/last bars from being cut off in a chart with time scale
- How to use percentage scale with Chart.js
- How to import Chart.js with Webpack
- How to drill down charts with ChartJS?
- Chartjs linechart with only one point - how to center
- How to fix chart Legends width-height with overflow scroll in ChartJS
- How to display Line Chart dataset point labels with Chart.js?
- chart js how to fill legend box with colour
- How to fix bars in Chart.js with long labels
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- chartjs: How to plot multi-line chart with irregular intervals
- How do I place a new line in a label with Chart.js?
- How to display inline values in a stacked bar chart with Chart.js?
- How to display data labels outside in pie chart with lines in ionic
- How to customize Title position with ChartJS
- how to get React chartjs to resize back down with window
- How to work out Chartjs using TypeScript with Chartjs.definitelyTyped from github
- How to set ticks on axes dynamically with chart.js?
- How to dynamically use chartjs-plugin-annotation with ng2-charts?
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How can I specify "per dataset" parsing with Chart.js?
- How to draw round edges with chart.js for line diagrams
- How to create dynamic charts with Django and Chart.js?
- how to use chart.js with react Hook?
More Query from same tag
- Chart.js same Y axis on left and right
- chartjs is issue with large amount data
- Chart.js setting maximum bar size of bar chart
- Stacked bar chart with chartjs with included values
- How can I datalabels and Sum display in the same time on a stacked bar
- ChartJS 2.0 - Huddle labels on pie chart
- using array values in chart.js data and label field
- Unable to pass on data from json file to labels and datasets in chart.js
- Remove the vertical line in the chart js line chart
- Chart.js not showing data until I click on the label 3 times
- How to distribute the y-ticks proportionally in Chart.js in Flask app?
- How to chart missing data in chartjs
- Background-color for area below line chart in chartJs?
- Is there any way I can customize my chartjs
- Extend chart.js in PHP heredoc causes parse error
- Chart js different background for y axis
- Tooltip flickering when hovered on chart
- chart.js filltext object moved when tooltip is generated because of legend not displaying
- How to add commas when showTooltips is false in ChartJS
- Changing the Y axis unit in Chartjs
- Printing chartjs tooltips
- Chart.js not stretching width as per data
- How to turn off tooltip for primeng pie chart?
- How to Change the Y axis of an Primefaces 7.0 ChartJS Linechart with Java?
- How to get fixed legend and tooltip for dynamically generated data vue-chartjs
- How to show dynamic dates with month name of current month and previous month in momentjs?
- How to do click the HTML button as if the user is clicking
- ChartJs bar not showing up
- How to set equal width between ticks - chartjs
- Is there anyway to remove the dots for points from angularjs charts