Arunkumar Vasudevan
Arunkumar Vasudevan

Reputation: 5330

How to Add X axis Padding in chart js Line Graph

I drawn a Line graph using chart js. it works well but problem is it will start all the lines from 0 but i need some padding between graph line and axis line it. I need like

enter image description here

I need this Gap ( Red Marked ). How can i achieve this??

Upvotes: 0

Views: 3031

Answers (1)

Mistalis
Mistalis

Reputation: 18279

From the fiddle you provided, A tricky way will be to push in $scope.labels and $scope.data a null in first position:

$scope.labels.unshift('');
$scope.data[0].unshift(null);
$scope.data[1].unshift(null);

A start you had:

enter image description here

And you will have:

enter image description here

Upvotes: 2

Related Questions