Chartjs-Angular-chart.js doughnut chart : how to show data in the center of a chart

1đź‘Ť

No don’t see anything in Chart.JS that would let you position some text like that, they have title text but can only be “top” or “bottom” http://plnkr.co/edit/oYQ1WKoNq78fGVIO5eEK?p=preview <– put together a plunkr to poke around with it but doesn’t look like the underlying lib supports that kind of overlaid text.

<!DOCTYPE html>
<html>

  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.js"></script>
    <link rel="stylesheet" href="style.css" />
  </head>

  <body ng-app="app" ng-controller="DoughnutCtrl">
    <h1>Hello Plunker!</h1>
    <canvas id="doughnut" class="chart chart-doughnut"
      chart-data="data" chart-labels="labels">
    </canvas> 
    <script data-require="angular.js@1.5.8" data-semver="1.5.8" src="https://code.angularjs.org/1.5.8/angular.js"></script>
    <script src="https://cdn.rawgit.com/jtblin/angular-chart.js/master/dist/angular-chart.js"></script>
    <script src="script.js"></script>
  </body>

</html>

Leave a comment