Highcharts - Column width not responsive -
i using highcharts 1 of projects , have unknown problem columns responsivity. since looks highcharts column graphs responsive default, stucked on same column width:
new highcharts.chart("highcharts-994d8ebb-5c08-4c83-b4d4-265ed2340006", { "chart": { "type": "column", "alignticks": false }, "plotoptions": { "series": { "datalabels": { "enabled": true }, "enablemousetracking": true, "animation": true } }, "title": { "text": "istorija snage" }, "subtitle": { "text": "poslednjih 30 dana" }, "exporting": { "enabled": false }, "yaxis": [{ "title": { "text": "snaga" }, "labels": { "format": "{value} mw" } }], "xaxis": [{ "labels": { "format": "{value:%d-%m-%y}" }, "type": "datetime", "title": { "text": "datum" } }], "series": [{ "type": 'column', "data": [ [1505088000000, 0], [1505001600000, 0], [1504915200000, 0], [1504828800000, 0], [1504742400000, 0], [1504656000000, 0], [1504569600000, 149], [1504483200000, 302], [1504396800000, 301], [1504310400000, 301], [1504224000000, 301], [1504137600000, 299], [1504051200000, 283], [1503964800000, 67], [1503878400000, 0], [1503792000000, 0], [1503705600000, 0], [1503619200000, 31], [1503532800000, 100], [1503446400000, 100], [1503273600000, 101], [1503014400000, 94], [1502928000000, 101], [1502841600000, 114], [1502668800000, 187], [1502409600000, 80], [1502236800000, 56], [1502150400000, 46], [1502064000000, 46], [1501977600000, 45] ], "name": "prosječna snaga (mw)", "_colorindex": 0, "_symbolindex": 0, "type": "column", "color": null, "negativecolor": "", "marker": { "enabled": false } }], "credits": { "enabled": false }, "legend": { "enabled": false, "layout": "horizontal" } }); my solution on jsfiddle here.
example of responsive column width on jsfiddle here.
i find column chart, , datetime axis, need specify pointrange.
since data appears daily data, can add point range of 1 day (adjust required):
pointrange: 86400000 this make each column take 1 day's worth of space on x axis.
fiddle:
reference:
Comments
Post a Comment