Search code examples
rgraph

how to give space between bar and it's label?


I am using RGraph in Angular7 and i want to apply space between bar and it's label

enter image description here


Solution

  • Looking at the style of the chart you might need to upgrade and then you could add the property yaxisLabelsOffsetx to your configuration. Here's an example:

    new RGraph.HBar({
        id:'cvs',
        data: [8,4,6,3],
        options: {
            marginInner: 10,
            variant: '3d',
            xaxis: false,
            yaxis: false,
            labelsAbove: true,
            labelsAboveOffsetx: 10,
            yaxisLabels: ['Jimmy','James','Tabatha','Richard']
        }
    }).draw();
    

    And a codepen of the example is here:

    https://codepen.io/rgraph/pen/mdReQmm