0
votes

I have a chart series data that ends with a not-rounded value (e.g 5.5).
The xAxis type is category and I want the last tick label to disappear.
I must use category type because I need the tickmarkPlacement attribute set to "between". I tried to set endOnTick to false but it seems like it doesn't apply on category type.

$(function () {

   var settings =  
        {
         "chart": {
           "type":"line"
        },
       "xAxis": { 
           "type": "category",
          "endOnTick":false
       },
       "series":[
           {"name":"series1","data":[[1,1200],[2,2200],[3,3200],[4,1800],[5,1500]]},
           {"name":"series2","data":[[1,1050],[2,2050],[3,1650],[4,1450],[5,1350]]},
           {"name":"series3","data":[[1,1250],[2,2250],[3,1850],[4,1650],[5.5,1550]]}]
       }

    var chart = $('#container').highcharts(settings);
});

That's how the chart looks like: Chart image:

And I want the "6" category label to disappear.

Link to simplified example: http://plnkr.co/edit/EleA25vPiTQ3EwFa

EDIT - My chart has a scrollbar, so if I use showLastLabel: false, it hides the currently displayed last label, even when the scrollbar is not at the end.

1

1 Answers

0
votes

You can set the showLastLabel to false to hide it.

   "xAxis": { 
       "type": "category",
      "endOnTick":false,
      showLastLabel: false
   },

Demo: http://plnkr.co/edit/5WRJIeGFyiUzRiGF?preview

API: https://api.highcharts.com/highcharts/xAxis.showLastLabel