HighCharts xAxis categories over 1000 data not work. - highcharts

I want to draw basic line chart.
When the data type of x-axis is numerical,
I can use the following options to draw this chart when the number of x labels is larger than 1000
plotOptions: {
line: {
turboThreshold: 2000,
},
series: {
turboThreshold: 2000,
}
}
But it seems not work when the data type is categorical and the number of category in x-axis is too large (> 1000 categories)
The link I had tried:
Test on jsfiddle
Is there any solution about this problem?
Many thanks

Check this fiddle: http://jsfiddle.net/am2k9c1t/
Code:
xAxis: {
tickInterval:10,
min:1200,
}

Set tickInterval value in xAxis.
example:
xAxis: {
tickInterval:100
}
Test it here

Related

Highcharts not creating correct amount of labels (steps) in xAxis only first and last labels

Here is a jsFiddle to my issue:
Highcharts.chart('container', {
xAxis: {
categories: [full arrray in fiddle],
labels: {
step: 1
}
},
series: [{
data: Array.from(Array(690).keys())
}]
});
https://jsfiddle.net/qws90dux/
The chart seems to only take the first and last label, why is this?
I think the reason this did not work is because of the amount of time needed to process each category which are long dates, this is basically what is written here
The solution was just to use xAxis.tickInterval instead, with the same interval as before.

Highstock. prevent gaps adding new line series

I want to draw a line on a ohlc chart, but i dont want the new series to introduce gaps.
The first series (ohlc) should still place the candles in an nica way with constant gaps between them regardles of open-close times (i think its only the "ordinal" value that does this, but unfortunatelly you cant specify it at series level, but only axis level).
xAxis: {
ordinal: true
},
example:
http://jsfiddle.net/5r97owky/8/
Thank you for any help
The gaps are caused by ordinal option. You can create additional xAxis for line series:
Highcharts.stockChart('container', {
chart: {
events: {
load: function() {
var xAxes = this.xAxis,
extremes = xAxes[0].getExtremes();
xAxes[1].setExtremes(extremes.min, extremes.max, true, false);
}
}
},
xAxis: [{}, {
visible: false
}],
...
});
Live demo: http://jsfiddle.net/BlackLabel/1mbo2zp4/
API: https://api.highcharts.com/highstock/xAxis.ordinal

Highcharts: bar/column chart label position with values of 0

If I have a Highcharts bar or column chart that has a data series with an array of all zeroes, the y axis tick label displays in the center of the y axis, along with an extra y axis. I've experimented with the tick placement and min values but these dont seem to work in the case of this peculiar set of data. see http://jsfiddle.net/davidpmcintyre/mepd17tn/
Here's the highcharts code snippet:
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr' ]
},
series: [{
data: [0, 0, 0, 0]
}]
});
});
Assuming (given requirements of your chart):
All data will be positive
You always want to start from 0 on the y-axis
The following code will allow you to left-align your y-axis, and also specify how much of the y-axis you want to show in minimal cases (JSFiddle):
yAxis: {
min: 0,
minRange: 1
}
This will still allow you to have larger ranges on the y-axis as it only kicks in when the value range is less than one. This in turn means you do not have to check your data before setting any values.

High charts not displaying date correctly in x axis per epoch?

Two Part Q:
Why is high charts not correctly aligning and displaying the following date on the x axis?
How can I align the date on the x axis with the points in each series?
I have tried adjusting to tickinterval to various values but to no avail on either issue.
tickPixelInterval: 200
Fiddle->http://jsfiddle.net/EwpWh/
Use datetime axis instead of linear, see: http://jsfiddle.net/Fusher/EwpWh/5/
xAxis: {
type: 'datetime',
labels: {
formatter: function () {
return Highcharts.dateFormat('%m/%d', this.value);
}
},
tickPixelInterval: 200
},
However if you want to have ticks exactly in the same place as points are, you need to use one of:
tickPositions: http://api.highcharts.com/highstock#xAxis.tickPositions
tickPositioner: http://api.highcharts.com/highstock#xAxis.tickPositioner

HighCharts Column Chart: Data Labels on Stacks Overlap

I have a column chart in HighCharts and having issues where data labels are running into each other. The graph has a static width and I could potentially have 4 series with at most 4 data points inside each series (4 stacks next to each other). I do have positive and negative values. I am seeing that if the series have similar values, each column is then the same height which causes the data labels to run into each other.
Any way to fix this issue? I cannot seem to find an library option that will help.
Added the groupPadding option worked for me:
plotOptions:
{
column:
{
dataLabels:
{
enabled: true,
formatter: function() { return this.y + '%' }
}
},
series:
{
groupPadding: 0.125
}
},
Have you tried increasing the width of the bars? What about adjusting the font size of the labels? A combination of these 2 APIs should help get around this given you have a static sized chart and a maximum of 4 series with 4 data points...
http://api.highcharts.com/highcharts#plotOptions.column.pointWidth
http://api.highcharts.com/highcharts#plotOptions.series.dataLabels.style

Resources