Highcharts

json_encode returning the next rows values - PHP PDO SQL HighCharts

☆樱花仙子☆ 提交于 2020-02-29 06:57:45
问题 When trying to use json_encode from arrays in foreach() the data moves in to the next values, for example: I have this table which is coming from the same query + php: when using json_encode to try and fit this tables data in to highcharts, my outcome is like this: [{"name":"User1","data":[0,2,0,0]},{"name":"User2","data":[0,2,0,0,2,0,2,4]}] So it's moving User1's data in to User2's My desired outcome would be: [{"name":"User1","data":[0,2,0,0]},{"name":"User2","data":[2,0,2,4]}] This is my

json_encode returning the next rows values - PHP PDO SQL HighCharts

邮差的信 提交于 2020-02-29 06:57:05
问题 When trying to use json_encode from arrays in foreach() the data moves in to the next values, for example: I have this table which is coming from the same query + php: when using json_encode to try and fit this tables data in to highcharts, my outcome is like this: [{"name":"User1","data":[0,2,0,0]},{"name":"User2","data":[0,2,0,0,2,0,2,4]}] So it's moving User1's data in to User2's My desired outcome would be: [{"name":"User1","data":[0,2,0,0]},{"name":"User2","data":[2,0,2,4]}] This is my

Highcharts time X axis

筅森魡賤 提交于 2020-02-25 13:22:45
问题 I would like to ask if somebody knows how to set X axis in Highcharts to time. My aplication is taking data from database and the frequency of the samples is 250ms. I want the X axis not to show counted values but something like time. I render 2500 values at once so that means 10 secs. The best would be to have on X axis and a mark there every 0.5 sec that means every 125 samples a mark. Like (0 samples = 0 sec);(125 samples = 0,5 sec);(500 samples = 1 sec);(725 samples = 1.5 sec) Thank you

How to remove “Values” and “series” from highcharts?

∥☆過路亽.° 提交于 2020-02-23 09:47:06
问题 I'm using highcharts on my website, which looks great, but I now want to remove these two labels from the chart: I tried disabling all sorts of labels, such as this one: { title: { text: 'X axis labels are disabled' }, xAxis: { labels: { enabled: false } }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] } but I can't find a way to remove these specifically. Here is the fiddle of the image above. Does anybody know how I can remove these

Sort the series data for every X-Axis in Highcharts

早过忘川 提交于 2020-02-15 08:32:26
问题 I need to sort the data of series from largest to smallest for every series. Sample fiddle series: [{ name: 'John', data: [{ y: 1}, {y: 2}, {y: 3}, {y: 4}, {y: 5 }] }, { name: 'Jane', data: [{ y: 5}, {y: 4}, {y: 3}, {y: 2}, {y: 1 }] }, { name: 'Joe', data: [{ y: 5}, {y: 2}, {y: 3}, {y: 4}, {y: 1 }] }] 回答1: You can use the sort function. It can be applied like that: series.forEach(function(name){ name.data.sort(function (a,b) { if(a.y < b.y) { return 1; } else if (a.y > b.y) { return -1; }

Sort the series data for every X-Axis in Highcharts

两盒软妹~` 提交于 2020-02-15 08:32:20
问题 I need to sort the data of series from largest to smallest for every series. Sample fiddle series: [{ name: 'John', data: [{ y: 1}, {y: 2}, {y: 3}, {y: 4}, {y: 5 }] }, { name: 'Jane', data: [{ y: 5}, {y: 4}, {y: 3}, {y: 2}, {y: 1 }] }, { name: 'Joe', data: [{ y: 5}, {y: 2}, {y: 3}, {y: 4}, {y: 1 }] }] 回答1: You can use the sort function. It can be applied like that: series.forEach(function(name){ name.data.sort(function (a,b) { if(a.y < b.y) { return 1; } else if (a.y > b.y) { return -1; }

Sort the series data for every X-Axis in Highcharts

ε祈祈猫儿з 提交于 2020-02-15 08:32:11
问题 I need to sort the data of series from largest to smallest for every series. Sample fiddle series: [{ name: 'John', data: [{ y: 1}, {y: 2}, {y: 3}, {y: 4}, {y: 5 }] }, { name: 'Jane', data: [{ y: 5}, {y: 4}, {y: 3}, {y: 2}, {y: 1 }] }, { name: 'Joe', data: [{ y: 5}, {y: 2}, {y: 3}, {y: 4}, {y: 1 }] }] 回答1: You can use the sort function. It can be applied like that: series.forEach(function(name){ name.data.sort(function (a,b) { if(a.y < b.y) { return 1; } else if (a.y > b.y) { return -1; }

How can I have same hover point color in highcharts?

不打扰是莪最后的温柔 提交于 2020-02-07 07:48:06
问题 I want to have same hover point color as when point was in hover off state. Plunker link here For example: for success tasks I have green colored point so on hover also point color should be green but instead it turns blue. Please help Code plotOptions: { ... series: { cursor: 'pointer', dataGrouping: { enabled: false }, marker: { radius: 4, states: { hover: { fillColor: null } } }, turboThreshold: 1000000 } }, 回答1: well as a roundabout to your problem you could try something like this

How to add footer for each series stacked horizontal bars in highcharts?

丶灬走出姿态 提交于 2020-02-07 02:36:14
问题 i have generated something like. with this code for highchart option: Highcharts.chart('container', { chart: { type: 'bar' }, colors: [ '#ff058d', '#9696b2'], title: { text: null }, xAxis: { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'], labels: { align: 'left', x: 0, y: -20, fontsize: '1em', color: 'black' } }, yAxis: { visible: false, min: 0, title: { text: 'Total fruit consumption' } }, legend: { visible: false, reversed: true }, plotOptions: { series: { stacking: 'normal

How to add footer for each series stacked horizontal bars in highcharts?

孤街浪徒 提交于 2020-02-07 02:36:02
问题 i have generated something like. with this code for highchart option: Highcharts.chart('container', { chart: { type: 'bar' }, colors: [ '#ff058d', '#9696b2'], title: { text: null }, xAxis: { categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'], labels: { align: 'left', x: 0, y: -20, fontsize: '1em', color: 'black' } }, yAxis: { visible: false, min: 0, title: { text: 'Total fruit consumption' } }, legend: { visible: false, reversed: true }, plotOptions: { series: { stacking: 'normal