HighCharts Export server "invalid" input data - highcharts

I'm testing the HighCharts Export server with a load of 1000 requests. All the requests are the same so I should receive the same output for the 1000 tests. The JSON request is the following:
{
"type": "png",
"scale": 1,
"infile": {
"chart": {
"backgroundColor": null,
"width": 1000,
"height": 200,
"style": {
"fontFamily": "Arial"
}
},
"title": {
"text": ""
},
"plotOptions": {
"bar": {
"pointPadding": 0,
"borderWidth": 0,
"dataLabels": {
"enabled": false,
"fontWeight": "normal"
}
}
},
"xAxis": {
"tickWidth": 0,
"gridLineColor": "#E2E8ED",
"categories": ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"],
"labels": {
"enabled": true,
"style": {
"fontSize": "14px",
"color": "#52626F"
}
}
},
"yAxis": {
"min": -4,
"max": 10,
"tickInterval": 2,
"labels": {
"format": "{value}%",
"style": {
"fontSize": "14px",
"color": "#52626F"
}
},
"title": {
"text": null
}
},
"series": [{
"name": "xxx",
"type": "column",
"color": "#C20044",
"pointWidth": 43,
"data": [3.65, 2.70, 1.40, -0.85, 0.25, -2.65, 1.40, -3.40, -1.30, 3.45, 1.35, -2.35]
},
{
"name": "xxx",
"type": "line",
"color": "#52626F",
"lineWidth": 1.5,
"marker": {
"enabled": false
},
"data": [3.65, 6.35, 7.75, 6.90, 7.15, 4.50, 5.90, 2.50, 1.20, 4.65, 6.00, 3.65]
},
{
"showInLegend": false,
"lineWidth": 0,
"data": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"marker": {
"enabled": false
}
}
],
"legend": {
"enabled": true,
"layout": "vertical",
"align": "right",
"verticalAlign": "middle",
"margin": 65,
"itemMarginBottom": 6,
"itemMarginTop": 6,
"symbolRadius": 0,
"style": {
"fontSize": "14px",
"color": "#52626F"
}
},
"credits": {
"enabled": false
}
}
}
And the output is this chart:
There is nothing wrong with the output itself but after a while the HighCharts Server returns an error which says that the input data was invalid.
[error] work 9fa383e8bd0f44f3a1e50dc95b13df71 could not be completed, sending: error when performing chart generation: please check your input data. However the request hasn't been changed. Mostly the error occurs when we're halfway.
I run the export server using the following command highcharts-export-server --enableServer 1 --port 8080 --workers 20 --workLimit 200
A worklimit of 200 seems me a good number because we cross this amount of requests.
Does anyone have an idea why it suddenly doesn't want to process the request and says I need to check my input data?
Btw. The export server is running in a docker container, but I think that does not cause the problem.

Related

Highchart-export-server not showing plot band correctly on chart

Plot bands in highchart export server is not working properly. I want the output same as shown in jsfiddle below.
I want the color plot band to show on y axis with width 20.
This is expected output: https://jsfiddle.net/vc6r8y3n/
Attached image is actual output when we use high-chart export server.
but when I tried same JavaScript json object on
http://export.highcharts.com/
its giving me image with plot band color spread on whole chart. its not considering width for 'y' or 'x' axis in export server. I gave attached image of export chart.
Why highchart behaving differently in both the cases.
Highchart JSON is same as in JSfiddle.
Actual image.
Expected is what it display in Jsfiddle. https://jsfiddle.net/vc6r8y3n/
{
"chart": {
"height": 350,
"width": 600,
"style": {
"fontFamily": "\"Arial\", sans-serif",
"fontSize": "16px"
},
"backgroundColor": "transparent"
},
"title": {
"text": null
},
"credits": {
"enabled": false
},
"legend": {
"align": "center",
"layout": "horizontal",
"verticalAlign": "bottom",
"symbolHeight": 5,
"symbolWidth": 5,
"symbolRadius": 0,
"itemDistance": 10,
"itemStyle": {
"fontSize": "5px",
"fontWeight": "bold",
"fontFamily": "\"Arial\", sans-serif"
},
"borderWidth": 0,
"padding": 0,
"margin": 5
},
"xAxis": {
"categories": [
"Sep-2020",
"Oct-2020",
"Nov-2020",
"Dec-2020",
"Jan-2021",
"Feb-2021"
],
"labels": {
"style": {
"fontSize": "4px",
"fontFamily": "\"Arial\", sans-serif",
"color": "#000"
},
"y": 5
},
"gridLineColor": "transparent",
"gridLineWidth": 0,
"minorGridLineWidth": 0,
"lineColor": "#9A9A9A",
"zIndex": 9999999
},
"yAxis": [
{
"title": {
"text": ""
},
"min": 0,
"max": 100,
"tickInterval": 20,
"plotBands": [
{
"color": "rgb(204,0,0)",
"from": 0,
"to": 30.99,
"zIndex": 3
},
{
"color": "rgb(226,113,113)",
"from": 31,
"to": 44.99,
"zIndex": 3
},
{
"color": "rgb(247,209,34)",
"from": 45,
"to": 54.99,
"zIndex": 3
},
{
"color": "rgb(136,207,136)",
"from": 55,
"to": 68.99,
"zIndex": 3
},
{
"color": "rgb(68,180,68)",
"from": 69,
"to": 87.99,
"zIndex": 3
},
{
"color": "rgb(0,153,0)",
"from": 88,
"to": 100,
"zIndex": 3
}
],
"width": 20
}
],
"plotOptions": {
"column": {
"dataLabels": {
"enabled": true
}
}
},
"series": [
{
"name": "Line1",
"type": "column",
"data": [
{
"y": 61,
"color": "#5b9bd5"
},
{
"y": 41,
"color": "#5b9bd5"
},
{
"y": 21,
"color": "#5b9bd5"
},
{
"y": 81,
"color": "#5b9bd5"
},
{
"y": 31,
"color": "#5b9bd5"
},
{
"y": 71,
"color": "#5b9bd5"
}
],
"color": "#5b9bd5",
"showInLegend": true
},
{
"name": "Line 2",
"type": "column",
"data": [
null,
null,
null,
null,
null,
1
],
"color": "#00B050"
},
{
"name": "Line 3",
"type": "spline",
"data": [
null,
{
"y": 45
},
{
"y": 38
},
{
"y": 32
},
{
"y": 40
},
{
"y": 48
}
],
"color": "#9A0229"
}
]
}
enter image description here

Render line chart across the plotting area

Highcharts line chart, how to render across plot area.
Trying to render the line chart using HighCharts library to span across the entire plotting area. Using xAxis.min was able to make sure the start is from 0 on xAxis, however, not able to figure out how to make it end where chart plot area ends.
$(function() {
$('#container').highcharts({
"chart": {
"margin": null,
"stacking": "normal",
"height": "250px",
"animation": false,
"events": {}
},
"plotOptions": {
"series": {
"dataLabels": {
"enabled": true,
"inside": true,
"align": "right",
"format": "",
"style": {}
},
"inside": true
}
},
"title": {
"text": null
},
"subtitle": {
"text": null
},
"xAxis": {
"title": {
"text": null,
"align": "high",
"rotation": 0,
"style": {},
"y": null,
"x": null
},
"plotLines": [],
"categories": [
"2019-06-10",
"2019-06-17"
],
"tickInterval": 1,
"tickPositions": [
1
],
"labels": {
"style": {},
"useHTML": true,
"align": ""
},
min: 0.5
},
"legend": {
"enabled": true,
"layout": "horizontal",
"align": "center",
"verticalAlign": "bottom",
"floating": false,
"x": 0,
"y": 0,
"symbolPadding": null,
"symbolRadius": null,
"itemStyle": {},
"itemDistance": null
},
"yAxis": [{
"title": {
"text": "",
"align": "high",
"rotation": 0,
"style": {}
},
"labels": {
"format": "{value}",
"style": {}
},
"opposite": false,
"yAxis": 0,
"lineWidth": 1,
"gridLineColor": "#e6e6e6",
"gridLineWidth": 1,
"gridLineDashStyle": "solid",
"index": 0
}],
"tooltip": {
"enabled": true,
"followPointer": false,
"shared": false
},
"credits": {
"enabled": false
},
"series": [{
"type": "line",
"name": null,
"fillOpacity": 0,
"color": "#0077bc",
"fillColor": "#0077bc",
"opposite": false,
"yAxis": 0,
"legendIndex": 1,
"marker": {
"enabled": true
},
"dashStyle": "Solid",
"data": [{
"y": 396,
"toolTipData": "<div>Times on Air : 396</div><br/>"
},
{
"y": 468,
"toolTipData": "<div>Times on Air : 468</div><br/>"
}
],
"_symbolIndex": 0
}]
});
});
https://jsfiddle.net/fzg0evns/
Instead of using dates as x-axis categories you can add a date to point x property and define x-axis type = "datetime". Check the demo posted below.
Code:
"xAxis": {
"type": "datetime",
...
},
"series": [{
...
"data": [{
"y": 396,
"x": new Date('2019-06-10').getTime(),
"toolTipData": "<div>Times on Air : 396</div><br/>"
},
{
"y": 468,
"x": new Date('2019-06-17').getTime(),
"toolTipData": "<div>Times on Air : 468</div><br/>"
}
]
}]
Demos:
With categories, tickInterval, and tickPositions.
Without them.
API reference:
xAxis.type
https://api.highcharts.com/highcharts/series.line.data.x

Export option not visible in Highcharts

When I generate my Highchart chart it generates complete. The only thing that doesn't show up is the export option.
Can anybody figure out what I am doing wrong?
Do I need to specify extra CSS styling options of some sort or include another JS script to allow this to work? I can't really figure it out at the moment.
chart1 = new Highcharts.Chart({
"chart": {
"renderTo": "container",
"type": "column"
},
"title": {
"text": "Doorlooptijd exploten"
},
"subtitle": {
"text": "Databron: Digibieb"
},
"xAxis": {
"categories": {
"2": "> xx",
"1": "< xx",
"0": "< xx"
}
},
"yAxis": {
"min": 0,
"title": {
"text": "Aantallen"
}
},
"legend": {
"layout": "vertical",
"backgroundColor": "#FFFFFF",
"align": "left",
"verticalAlign": "top",
"x": 100,
"y": 100,
"floating": 0,
"shadow": 1
},
"exporting": {
"enabled": true
},
"credits": {
"enabled": false
},
"plotOptions": {
"column": {
"pointPadding": 0.2,
"borderWidth": 0
}
},
"series": [{
"name": "asd",
"data": [1, 1, 1]
}, {
"name": "asd2",
"data": [1, 1, 1]
}, {
"name": "asd3",
"data": [1, 1, 1]
}, {
"name": "asd4",
"data": [0, 0, 25]
}, {
"name": "asd5",
"data": [54, 19, 53]
}, {
"name": "asd6",
"data": [0, 0, 4]
}, {
"name": "asd8",
"data": [22, 4, 28]
}, {
"name": "asd7",
"data": [23, 40, 19]
}, {
"name": "asd9",
"data": [23, 13, 8]
}, {
"name": "asd10",
"data": [3, 0, 0]
}]
});
You need to load the exporting.js script like this after the main Highcharts script
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
Fiddle

Using highcharts x-axis "zones" for datetime series chart

I've got a two-series Highcharts column chart that I'm trying to modify the color between past and future. I'd like the colors in past to be green, and colors in future to be blue essentially. I've read about highcharts "zones" which allow you to change attributes on the axis after a point, but the documentation uses a simple data chart, and not a datetime version like I'm using.
How can I use these zones with a datetime chart, or better-- how can I change the border/fill color of my bars for future instead of default colors used.
http://www.highcharts.com/docs/chart-concepts/series#zones
https://jsfiddle.net/x4n91jL8/
$(function () {
var colors = Highcharts.getOptions().colors;
colors[0] = 'rgba(255,255,255,0)';
colors[1] = '#7FC69E';
$('#container').highcharts({
"credits": {
"enabled": false
},
"chart": {
"renderTo": "container",
"type": "area",
"alignTicks": false,
"height": 300,
"marginLeft": 1,
"marginBottom": 1,
"backgroundColor": "transparent",
"events": {}
},
"title": {
"enabled": false,
"text": ""
},
"plotOptions": {
"series": {
"pointPadding": 0,
"groupPadding": 0.02,
"marker": {
"enabled": false
}
},
"column": {
"animation": false,
"grouping": false,
"pointPadding": 0,
"borderWidth": 0,
"allowPointSelect": false,
"events": {}
},
"line": {
"allowPointSelect": false,
"events": {}
},
"area": {
"allowPointSelect": false,
"events": {}
}
},
"legend": {
"enabled": false,
"layout": "horizontal",
"align": "center",
"verticalAlign": "top",
"floating": true,
"backgroundColor": "#FFFFFF"
},
"tooltip": {
"enabled": false,
"shared": true
},
"rangeSelector": {
"enabled": false,
"inputEnabled": true
},
"xAxis": {
"gridLineColor": "transparent",
"zIndex": 3,
"minorTickInterval": 604800000,
"minorTickPosition": "inside",
"minorTickLength": 5,
"minorTickWidth": 1,
"minorGridLineWidth": 0,
"startOnTick": false,
"gridLineWidth": 1,
"type": "datetime",
"min": 1451800000000,
"max": 1457000000000,
"labels": {
"enabled": false,
"step": 1
},
"dateTimeLabelFormats": {
"month": "%b",
"year": "%Y"
}
},
"series": [
{
"name": "Duration",
"zIndex": 3,
"type": "column",
"data": [
[
1452470400000,
6.5
],
[
1453075200000,
11.25
],
[
1453680000000,
8.25
],
[
1454284800000,
6.55
],
[
1454889600000,
1.05
],
[
1455494400000,
4.633333333333333
],
[
1456099200000,
1.1666666666666667
],
],
"tooltip": {
"yDecimals": 0
},
"borderWidth": 1,
"borderColor": "#008244",
"opacity": 0.6,
"lineWidth": 1,
"states": {
"hover": {
"lineWidth": 1
}
},
"zoneAxis": "x",
"zones": [
{
"value": 1454284800000
},
{
"borderColor": "#566888"
}
],
"_colorIndex": 0
},
{
"name": "Duration",
"zIndex": 3,
"type": "column",
"data": [
[
1454284800000,
5.216666666666667
],
[
1454889600000,
0
],
[
1455494400000,
2.6666666666666665
],
[
1456099200000,
1.1666666666666667
],
],
"tooltip": {
"yDecimals": 0
},
"borderWidth": 0,
"borderColor": "#008244",
"opacity": 0.6,
"lineWidth": 1,
"states": {
"hover": {
"lineWidth": 1
}
},
"zoneAxis": "x",
"zones": [
{
"value": 1454284800000
},
{
"fillColor": "#566888"
}
],
"_colorIndex": 1
}
],
"yAxis": [
{
"labels": {
"enabled": false
},
"opposite": false,
"gridLineWidth": 0,
"minorGridLineWidth": 0,
"showEmpty": false,
"title": {
"text": "",
"align": "middle",
"style": {
"color": "rgba(255,255,255,0)"
}
},
"lineWidth": 1,
"min": 0,
"startOnTick": false,
"endOnTick": false,
"max": 16.875,
"lineColor": "rgba(255,255,255,0)",
"index": 0
}
]
});
});
The correct format is actually like this:
And it also requires Highcharts 4.1.4 (I was using an older 4.0.4 actually).
"zones": [
{
"value": new Date().getTime(),
"color":'#7FC69E'
}
}

How do I force highcharts to pay attention to min and max on my secondary axis?

I'm trying to set a secondary axis with a min/max value, and the primary axis often overwrites the max on the secondary axis.
I know that I could use alignTicks:false, but I don't like the way that makes the ticks look. I also know that I can hide the ticks for one of the axes, but again, I don't like they it looks.
I would like to either force the right side to use min/max and figure out the proper tick intervals, or I'd like to force the left side to have a specific number of ticks.
I need some ideas, here's a jsfiddle with my code and some mock data.
http://jsfiddle.net/2s6kK/
$(function () {
$('#container').highcharts({
"title": {
"text": ""
},
"subtitle": {
"text": ""
},
"xAxis": {
"type": "datetime",
"dateTimeLabelFormats": {
"day": "%b %e"
}
},
"yAxis": [{
"min": 0,
"startOnTick": false,
"labels": {
"style": {
"color": "#4074C3"
}
},
"title": {
"text": "Revenue",
"style": {
"color": "#4074C3"
},
"margin": 5
},
"index": 0
}, {
"allowDecimals": false,
"min": 0,
"max": 100,
"maxPadding": 0.2,
"startOnTick": false,
"labels": {
"style": {
"color": "#8DAD36"
}
},
"title": {
"text": "Win Rate",
"style": {
"color": "#8DAD36"
},
"margin": 2
},
"opposite": true,
"index": 1,
// "alignTicks": false
}],
"legend": {
"enabled": true,
"align": "center",
"verticalAlign": "top",
"x": 0,
"y": -5,
"borderWidth": 0
},
"series": [{
"name": "Revenue",
"type": "line",
"yAxis": 0,
"data": [5.4,27,27,27,58,0, 0, 0, 0
],"pointStart":1377993600000,"pointInterval":86400000
}, {
"name": "Win Rate",
"type": "line",
"color": "#8DAD36",
"yAxis": 1,
"data": [60,48,48,48,48,60, 0, 0, 0, 0
],"pointStart":1377993600000,"pointInterval":86400000
}]
});
});
Thanks,
Josh
You could try setting your tickInterval to 10 in your y-axis definition:
"tickInterval": 10
http://jsfiddle.net/2s6kK/1/

Resources