Skip to content

Problem with padding / margin on Ticks and scaleLabels #3629

@AnghelGabriel

Description

@AnghelGabriel

I have this screen and i want to do the following.
A: custom spacing between scaleLabel and Ticks text.
B: custom spacing between scaleLabel and axis.
C: custom spacing between scaleLabel and Ticks.

chart-js-problkems

I managed to do B: by using this code

 scales:{
           xAxes: [{
             display:true,
             gridLines:{
               display:true,
               zeroLineWidth:1,
               zeroLineColor:'#f5f4f0',
               color:"#f5f4f0",
               tickMarkLength:25,
               //drawBorder:false,
               drawTicks:false
             },
             ticks:{
               stepSize:5000,
               fontSize:14,
               fontStyle:"normal"
             },
             scaleLabel:{
               display:true,
               labelString:"Visitors",
               fontSize:14,
               fontStyle:'bold',
               fontColor:'#363532',
               paddingTop:30
             }
           }]
}

Basically i set drawTicks to false and added tickMarkLenght to 25 but i encountered the following problem as see in the picture.

chart-js-problkems-solved

Can anybody point me in the right direction?
How can i customize scaleLabels padding / margins as how can i customize Ticks text margins / padding.
Also will be nice for an answer for the ABC problems i'm facing.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions