Bind angularjs currency to scaleLabel in chart.js

👍:0 You can do this, however you’d have to tack your bit of code that does the formatting to some global object (which IMO is not very maintainable). This is how you do it myApp.controller(‘myCtrlr’, [‘$filter’, ‘$scope’, function ($filter, $scope) { Chart.currencify = function(value) { return $filter(‘currency’)(value); } … … var myChart = new Chart(ctx).Line(data, … Read more

How to add symbols in angular charts?

0👍 ✅ By simply inserting chart option in your html markup and specifying template for your tooltip will work for you. <canvas id=”doughnut” class=”chart chart-doughnut” chart-data=”data” chart-labels=”labels” chart-options=”{tooltipTemplate: ‘<%=label%>:<%=value%>%’}”> </canvas> Here is the working CodePen for same. "Responsive" Chart.js chart is taller than the containing window

"Responsive" Chart.js chart is taller than the containing window

👍:0 I think it’s a good idea using the viewport height on your case. That’s fairly easy in Javascript: <html> <head> <meta charset=”utf-8″/> <title>TEST</title> <style> * {padding: 0; height: 0;} canvas { width: 100%; } </style> </head> <body> <canvas id=”chart”></canvas> <script src=”https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js”></script> <script> var data = { labels: [“January”, “February”, “March”, “April”, “May”, “June”, “July”], … Read more

Custom tooltip in Chart.js

👍:0 In the example you can see how to do this, you can note that i use doughut but is the same idea to do this with pie chart: <script src=”https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js”></script> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <canvas id=”chart-area” style=”display:inline;”></canvas> <script> var doughnutData = [ { value: 200, color: “#FFF”, label:”White”, }, { value: 200, color: “#bb2028″, label:”Red”, }, … Read more

Chart.js dynamically-created charts do not obey chart options

👍:0 If you have different chart options for each chart, you need to create a clone of the chartOptions object for each chart. For plain JavaScript, I usually prefer https://stackoverflow.com/a/4591639/360067 for its simplicity, but if you have libraries (jQuery, etc) you have a lot of other options. Programmatically creating labels for Chart.js in angular? Destroying … Read more