1

I was trying to show the data values using the arrow using the chartjs as shown in the the above image. But, I did not find any documentation for it. Please, help!

1
  • yes, I am familiar that it is possible with high chart. But, the solution required using the chartjs. @Sajeetharan Commented Jan 10, 2018 at 9:27

1 Answer 1

1

Using Chart.PieceLabel.js plugin you can obtain not exactly what's expected but something similar: labels outside the slices.

angular.module("app", ["chart.js"]).controller("ChartCtrl", function($scope) {

    $scope.labels = ["January", "February", "March", "April", "May", "June", "July"];
    
    $scope.data = [65, 59, 80, 81, 56, 55, 40];
    
    $scope.options = {
      pieceLabel: {
        render: 'label',
        fontColor: '#000',
        position: 'outside'
      }
    };
  
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.1/Chart.js"></script>
<script src="https://cdn.jsdelivr.net/angular.chartjs/latest/angular-chart.js"></script>
<script src="https://rawgit.com/emn178/Chart.PieceLabel.js/master/build/Chart.PieceLabel.min.js"></script>

<div ng-app="app" ng-controller="ChartCtrl">
  <canvas id="pie" class="chart chart-pie"
         chart-data="data" chart-labels="labels" chart-options="options">
  </canvas> 
</div>

Update:

With a fork of Chart.PieceLabel.js plugin labels have also callout arrows.

Check the fiddle updated: https://jsfiddle.net/beaver71/8ytvggcL/

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! I it would help to a extend but looking forward for the data point with arrow as shown in image.
Hey! Thanks alot! Really appreciate your effort! That is what I exactly needed!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.