javascript - How to add padding in a bar chart between the outer bars and the left/right sides in Chart.js? -


when creating bar chart in chart.js bars take whole horizontal space. how can add padding left , right bar achieve see in image below:

enter image description here

alternativly may achieved if bars aligned in center , using max-width in percentage on bars itself, never fill whole space. can't find options either.

currently i'm adding 2 0 values blank labels on each side, works, it's workaround:

var data = {     labels: ['', '', 1, 2, 3, '', ''],     datasets: [{         data: [0, 0, 36500, 59000, 65000, 0, 0],          backgroundcolor: [               null,null,               'blue','blue','blue',               null,null         ],     }] }; 

i'm using chart.js 2.3.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -