sk786
sk786

Reputation: 414

Highcharts show only particular ticks when large number of x-axis ticks

My Bubble Chart - https://jsfiddle.net/cm4fortp/

Here in this chart I am showing data of last 3 months. The problem is due to width, Highcharts is wrapping up the x-axis ticks i.e. showing only few x-axis labels. I want to show the label for every first date of month and also on 2-weeks interval.

I have used following formatter to play with x-axis labels but not all indexes are coming here.

xAxis: {
    labels: {
        formatter: function() {
            if(this.value!=-1 && this.value!=0){

                     console.log(this.value); //to print all the x-axis index

            }
        }
    }
}

I am looking for maybe something that can give me all the x-axis index or can force Highcharts to display all x-axis labels or something horizontal scroll so that I can increase and fix the width of chart to show all labels.

Upvotes: 0

Views: 2012

Answers (1)

Wojciech Chmiel
Wojciech Chmiel

Reputation: 7372

To show as many ticks as you want you can use xAxis.tickPositions - an array defining where the ticks are laid out on the axis.

API reference:

Upvotes: 2

Related Questions