Rotated partial doughnut chart with a point marker in chart.js agularJS

πŸ‘:0 I don’t think it can render partial doughnut/pie charts, but have you considered using a β€œblank” datapoint? This datapoint can be that remaining 1/4 value (blankData = 100 – (data1 + data2 + data3 + etc…)) You can set the coloring on it to be transparent or to match your page’s background colors. In … Read more

Chart.js charts wouldn't show or hide with Angular directives ng-show and ng-hide

πŸ‘:0 Short answer: Wrapping chart creation in $timeout(with default timeout of 0 ms) works: Long answer: $timeout with delay set to 0 removes the necessity to call $apply, because $timeout will trigger another $digest cycle of its own, which in turn will do all the necessary updating. $scope.output.showChart = true; $timeout(function(){ if($scope.lineChart){ $scope.lineChart.destroy(); } var … Read more

Drawing bar chart with chart.js jQuery

πŸ‘:0 The bar data format is different from the pie data format. Also, you haven’t included your index in the textbox selector. You need to change your handler to $(document).on(β€œclick”, β€œ#drawChart”, function (event) { data = { labels: [], datasets: [ { fillColor: β€œlightblue”, data: [] } ] }; for (var i = 0; i … Read more

Angular-chart.js – define set Y axis width

0πŸ‘ βœ… Actually, I think I figured out a very basic and static way for setting the width. In chart.js (version 1.0.2), line 1576: this.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) + 10 : 0; I simply changed that to a static number, ’93’. this.yLabelWidth = 93; I’m sure with a bit more tinkering I … Read more

Chart.js – In Graph Data for Pie & Doughnut Charts

0πŸ‘ βœ… You can use Chart.js to generate a chart in your design. var data = [ { value: 20, color:”#F7464A” }, { value: 13.3, color: β€œ#46BFBD” }, { value: 6.7, color: β€œ#FDB45C” }, { value: 6.7, color: β€œ#FDB45C” }, { value: 6.7, color: β€œ#FDB45C” }, { value: 46.6, color: β€œ#FDB45C” } ] var options … Read more

Remove y and x axis lines and change axis font style in Chartjs

πŸ‘:0 I want to completley remove the lines from the y and x axis, not just the grid lines but the left and bottom lines. Just set the scale line color to transparent in the options, like so … scaleLineColor: β€œrgba(0,0,0,0)”, … Additionally, how would I change the font style of the axis labels to … Read more