ZingChart: Hiding The First Label On The Scale

Sometimes you want to hide the first label on the scale of your chart. Lets get into the basics of how you can do this. You will typically use our rules to hide the first label and first tick.

Hiding A Scale Label

scaleY:{
   item:{ //hides the first label
     rules:[
         {
           rule:'%i == 0',
           visible: false
         }
       ]
   },
   tick:{  //hides the first tick
     rules:[
         {
           rule:'%i == 0',
           visible: false
         }
       ]
   }
 },

Example: https://demos.zingchart.com/view/43VQGEH9

You Can use the same code but on the x-axis for charts that are not flipped.

scaleX:{
 item:{ //hides the first label
   rules:[
       {
         rule:'%i == 0',
         visible: false
       }
     ]
 },
 tick:{  //hides the first tick
   rules:[
       {
         rule:'%i == 0',
         visible: false
       }
     ]
 }
},
scaleY: {
item:{ 
   rules:[ // position the first label down
       {
         rule:'%i == 0',
         offsetY:10,
         offsetX:5
       }
     ]
 },
  tick:{  //hides the first tick
   rules:[
       {
         rule:'%i == 0',
         visible: false
       }
     ]
 }
},

Example: https://demos.zingchart.com/view/43VQGEH9

Documentation

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us