I´m setting up a preview for a graph, and I want to know if highcharts has any option for reducing the number of points showed in a series. I have points everyday in 5 years, and I would like to reduce for a simple preview. Is this possible?
You can reduce the number of points by your own function, but I think that the best solution will be to use provided by Highstock dataGrouping feature:
series: [{
dataGrouping: {
enabled: true
},
data: [...]
}]
Live demo: http://jsfiddle.net/BlackLabel/3ky0s2oh/
API Reference: https://api.highcharts.com/highstock/plotOptions.series.dataGrouping.enabled
Docs: https://www.highcharts.com/docs/stock/data-grouping
Related
I'm building a milestone comparison chart using Highcharts Gantt.
Each of my milestones has a short acronym for the milestone "type", which I want to show as data labels, and I want them to always be above the milestone marker.
I managed to get them outside the markers by setting
dataLabels: {
inside: false
}
on the series, but Highcharts is only putting the labels above the markers on the first row of data, on subsequent rows it's putting the labels below:
I tired playing around with the verticalAlignment setting, but that doesn't seem to do what I want it to do.
How can I force Highcharts to always position the data labels above the milestone markers?
You can position data labels above the markers by using y property:
series: [{
...,
milestone: true,
dataLabels: {
...,
y: -10
}
}, ...]
Live demo: https://jsfiddle.net/BlackLabel/yv641op0/
API Reference: https://api.highcharts.com/gantt/series.gantt.dataLabels.y
I want to create a boxplot chart with zones using Highcharts. It seems that highchart uses the high value as threshold.
Does anyone know if it is possible to change that to use the median for example ?
See https://stackblitz.com/edit/highcharts-boxplot-zones
Thanks !
Well, the chart renders exactly as you instruct it.
760, 801, 848, 895, 1265
If you want a different chart you would change the variables. In each case, the chart is rendering boxplots according to your data.
It is not officially supported, but you can set zoneAxis for example to 'median':
series: [{
data: [ // low, q1, median, q3, high
...
],
...,
zoneAxis: 'median'
}]
Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/5001/
API Reference: https://api.highcharts.com/highcharts/series.boxplot.zoneAxis
I got a problem with a Highcharts Graph. It's a line stock-chart and it works quite well if there are just a few hundred data points but if I try to display a few thousand it shows (in the tooltip) more than 2 up to 13 decimals (eg 16.5772857142857). I'm rounding the data at the beginning to 2 decimals and "valueDecimals" is at 2 in the tooltip. I guess if there are too many data points which are very close, Highcharts tries to find an average. Does someone knows how to limit the decimals generally or had the same problem?
That is caused by dataGrouping feature. You can read more about it in the docs. To turn it off, set:
series: [{
dataGrouping: {
enabled: false
},
data: [...]
}]
Live demo: http://jsfiddle.net/BlackLabel/3x06skoc/
API Reference: https://api.highcharts.com/highstock/series.line.dataGrouping.enabled
Docs: https://www.highcharts.com/docs/stock/data-grouping
I have a jqplot chart with 8 series. 7 of these are normalized in such a way that they look great with the default yaxis. The last series, however, needs to utilize a secondary yaxis. There are a ton of examples on utilizing a dual yaxis presentation when there are only two series.
So my question: Can you assign a specific series to a specific axis? If so, how?
Thanks in advance!
Ok -- I ended up finding an example in the api docs, where previously I was searching through the examples.
{
series:[
{color: '#ff4466', lineWidth: 5, label:'good line'},
{yaxis: 'y2axis', shadow: false, label:'bad line'}
]
}
The yaxis option is available per series, which allows a specific series to be assigned to a specific yaxis.
I hope this helps someone else.
I've been trying to add some custom yAxis labels to highcharts but I've not been able to so far. I've tried using formatter from a predefined array of strings and I've tried addAxis method but that doesn't get me the results I'm looking for.
Basically I have some numbers (lets say 4 and 4000) and I want to have these as my yLabels. However, I do NOT want the giant space between them. They need to be one right after the other and in ascending order. I cannot figure out how to do this leaving them as integers and I cannot figure out how to dynamically add them to highcharts as strings. I'm not even sure if this is possible
Any help would be greatly appreciated.
Here is the Y-axis label formatter documentation from Highcharts you're probably looking for. I wrote this fiddle to simulate the custom y-axis functionality you were wanting, although I'm not sure how you want to map those values to the x-axis data. This should give you a good starting point.
Code for reference:
$('#container').highcharts({
yAxis: {
categories: ['4', '4000', 'Foobar'],
labels: {
formatter: function () {
return this.value;
}
}
},
series: [{
data: [0, 1, 2]
}]
});
This stackoverflow question may also help although I noticed some dead links.