I want to create histogram using both values Xaxis should be ak value and Y axis should be kd values getting error when creating datatables error(2.php:11 Uncaught SyntaxError: Unexpected number)
Encode first the data via json encode to use them in javascript Example:
$post_data = json_encode($post_data);
If you do this then post the new $post_data format to see how it we manipulate them to using in js
Thanks Liontas!
I did that here you can see i think i have issues in parsing at var data = new google.visualization.DataTable(pausecontent);
Here is my code.2.php (1.1 KB)
one more thing is that it is taking random values 0,1,2,3,4 for x axis but i have some values that are not numbers, So i changed x axis values(SIS-L5-outside_rm_5019) with index values so that it can be single value plot but i’m not able to parse it. What i’m trying is here i have values on y are 12 so i’m taking on x axis 1-12numbers.
[{“1”:1275.5506213987728,“2”:1290.7307725817402,“3”:1302.7705921254517,“4”:1243.072037173642,“5”:1162.4230535715515,“6”:1149.6843381106778,“7”:1162.1262680994546,“8”:1069.311558075748,“9”:1058.0760042458824,“10”:1007.6567717160162,“11”:1029.8077281040871,“12”:1010.439987814117}];
Are you sure that the Histogram is the graph for your case?As i read at google
A histogram is a chart that groups numeric data into bins, displaying the bins as segmented columns. They’re used to depict the distribution of a dataset: how often values fall into ranges.
In above mention plot the problem is ti is plotting all values at 0(x axis) instead of that it should plot like that
X:Y
1:1275.5506213987728
2:1290.7307725817402
3:1302.7705921254517
4:1243.072037173642
5:1162.4230535715515
6:1149.6843381106778
7:1162.1262680994546
8:1069.311558075748
9:1058.0760042458824
10:1007.6567717160162
11:1029.8077281040871
12:1010.439987814117