Chartjs-Height for chart area (not the canvas size)?

0👍

With ChartJS

When your labels become little automatically the labels get vertically aligned as shown

And with Both Small and Large Size Label Canvas is consuming me Same Height and Width

width: 430px; height: 215px;

Large Label

  $scope.labels = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

enter image description here

With Small Label

$scope.labels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

enter image description here

HTML

<div class="col-md-4">
  <div style="height:auto; width:auto;">
        <div ng-controller="LinemsoVersionCtrl">
          <canvas id="line" class="chart chart-line" chart-data="data" chart-labels="labels" chart-series="series" chart-options="options" chart-dataset-override="datasetOverride" chart-click="onClick"></canvas>
        </div>
</div>
</div>

CSS

  .col-md-4 {
    width: 33.33333333%
  }

Leave a comment