错误地生成高图 [英] incorrect generation of highcharts
问题描述
<?php $ monthlyParticipation ='[{project_title: test project 44,project_ref_id:113,amount:13000.00,months:Feb},{project_title:sdsdsd,project_ref_id:112 : 50000.00\" , 月: 月},{ PROJECT_TITLE: 是testing123, project_ref_id: 104, 量: 232323.00, 月: 月},{ project_title:hello wolrd,project_ref_id:111,amount:30000.00,months:Mar,{project_title:道路建设,project_ref_id:108 量: 1000.00, 月: 四月},{ PROJECT_TITLE: sdsdsd, project_ref_id: 112, 量: 2000.00, 月: 四月},{ PROJECT_TITLE : sdsdsd, project_ref_id: 112, 量: 354357.00,30000.00, 月: 月}]'; ?>
月份必须以x轴表示。
在y轴上,系列
下的名称为project_title,
为系列
我尝试了以下代码 https:// jsfiddle .net / neb22v3j / 1 /
但生成的图形不正确。它不符合json数据
x轴必须是月份y轴应该显示相对于project_title的金额。我试过的是给其他月份的月份数额。这个数额与它显示的月份无关。
请帮我解决问题。
为了将您的观点分配到正确的月份,您必须传递 null
作为所有月份的值有数据。
我写了一个新函数来解析数据,将数据点值设置为 null
,如果项目没有当前月份的价值。 (检查代码中的注释)
a>
I am getting data in json format as below
<?php $monthlyParticipation='[{"project_title":"test project 44","project_ref_id":"113","amount":"13000.00","months":"Feb"},{"project_title":"sdsdsd","project_ref_id":"112","amount":"50000.00","months":"Mar"},{"project_title":"testing123","project_ref_id":"104","amount":"232323.00","months":"Mar"},{"project_title":"hello wolrd","project_ref_id":"111","amount":"30000.00","months":"Mar"},{"project_title":"road construction","project_ref_id":"108","amount":"1000.00","months":"Apr"},{"project_title":"sdsdsd","project_ref_id":"112","amount":"2000.00","months":"Apr"},{"project_title":"sdsdsd","project_ref_id":"112","amount":"354357.00,30000.00","months":"May"}]'; ?>
The months has to represented in x-axis.
In y-axis, project_title as name under series
,
amount as data under series
I have tried the below code https://jsfiddle.net/neb22v3j/1/
But the graph generated is incorrect. It doesnt match with the json data
The x-axis must be the month y-axis should display the amount against the project_title. What I tried is giving the amount of a month to some other month. The amount is not relevant to the month under which it is displaying.
Please help me to fix the issue
For your point to be assigned to the correct month you have to pass null
as the value for all the months that don't have data.
I wrote a new function to parse the data that sets the datapoint value to null
if the project doesn't have a value for the current month. (check the comments in the code)
这篇关于错误地生成高图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!