nimo23
nimo23

Reputation: 5708

hide time gaps between points of line chart

How can I hide the time gap between two data points of a line chart when there are no values between them?

For example, 3 points:

I have tried it with

series: {
connectNulls: fals,
}

Did not work. Is there a other property for this?

Upvotes: 2

Views: 3546

Answers (1)

Jeffrey Roosendaal
Jeffrey Roosendaal

Reputation: 7157

Do not show datapoints

Use null as value:

series: {
    data: [5, 2, null, null, 4, 5]
}

You do not need to use connectNulls.

enter image description here


Do not show x axis ticks

When you want to hide the x axis ticks for empty datapoints, switch your x axis to type: category, and exclude those values. Be sure to exclude them from your series as well.

xAxis: {
    type: 'category',
    data: ['thursday', 'friday', 'monday', 'tuesday']
},
series: {
    data: [5, 2, 4, 5]
}

enter image description here

Upvotes: 4

Related Questions