473,366 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,366 software developers and data experts.

having problem in displaying flash data-line chart with database contents

25
HI there,
Need Help...

This is data file's result:
Expand|Select|Wrap|Line Numbers
  1. { "elements": [ { "type": "line", "values": [ 107, 107, 121, 107, 109, 107, 121, 108, 108, 107, 120, 120, 120, 107 ], "dot-style": { "type": "dot", "tip": "#val#", "dot-size": 5, "colour": "#DFC329" }, "width": 2, "colour": "0x9933CC", "tip": "#Hello#", "text": "DisHonest Follower", "font-size": 10 }, { "type": "line", "values": [ 9, 9, 0, 9, 8, 9, 0, 8, 8, 8, 0, 0, 0, 8 ], "dot-style": { "type": "star", "dot-size": 5 }, "width": 2, "colour": "0xCC3399", "text": "ActiveHonest Follower", "font-size": 10 }, { "type": "line", "values": [ 5, 5, 0, 5, 4, 5, 0, 5, 5, 5, 0, 0, 0, 5 ], "width": 2, "colour": "0x80a033", "text": "InactiveHonest Follower", "font-size": 10 } ], "bg_colour": "#FFFFFF", "x_axis": { "steps": 86400, "labels": { "text": "#date: jS, M Y#", "steps": 86400, "visible-steps": 1, "rotate": 60 } }, "y_axis": { "min": 0, "max": 400, "steps": 50 } } 
  2.  
This is the code for it:
Expand|Select|Wrap|Line Numbers
  1. { //these arrays are declared above
  2.  
  3.     $data_1[] = intval($disf[$i]);
  4.     $data_2[] = intval($af[$i]);
  5.     $data_3[] = intval($inf[$i]);
  6.         $data_4[] = $logindate[$i];
  7.  
  8. }
  9.  
  10. //***** Purple line
  11.  
  12. $default_dot = new dot();
  13. //$default_dot->tooltip('#x_label#<br>#val#');
  14. $default_dot->tooltip('#val#');
  15. $default_dot->size(5)->colour('#DFC329');
  16. $line_dot = new line();
  17. $line_dot->set_default_dot_style($default_dot);
  18. $line_dot->set_width( 2 );
  19. $line_dot->set_colour( '0x9933CC' );
  20. $line_dot->set_values( $data_1 );
  21. $line_dot->set_tooltip('#Hello#');
  22. $line_dot->set_key( "DisHonest Follower", 10 );
  23.  
  24. //***** Pink line 
  25.  
  26. $default_hollow_dot = new hollow_dot();
  27. $default_hollow_dot->tooltip('#x_label#<br>#val#');
  28. $default_hollow_dot->size(5)->colour('#6363AC');
  29.  
  30. $line_hollow = new line();
  31. $line_hollow->set_default_dot_style($default_hollow_dot);
  32. $line_hollow->set_width( 2 );
  33. $line_hollow->set_colour( '0xCC3399' );
  34. $line_hollow->set_values( $data_2 );
  35. $line_hollow->set_key( "ActiveHonest Follower", 10 );
  36.  
  37. //***** Green line
  38.  
  39. $star = new star();
  40. $star->size(5);
  41. //$star->set_tooltip("#x_label#<br>#val#");
  42. $line = new line();
  43. $line_hollow->set_default_dot_style($star);
  44. $line->set_width( 2 );
  45. $line->set_colour( '0x80a033' );
  46. $line->set_values( $data_3 );
  47. $line->set_key( "InactiveHonest Follower", 10 );
  48.  
  49. //*****create an X Axis object setting X-axis labels
  50. $x = new x_axis();
  51. // grid line and tick every 10 show ticks and grid lines for every day:
  52. // grid line and tick every 10
  53.  
  54. $x->set_range(
  55.     mktime(0, 0, 0, 6, 1, date('Y')),    // <-- min 
  56.     mktime(0, 0, 0, 6, 16, date('Y'))    // <-- max 
  57.     );   
  58. $x->set_steps(86400);
  59.  
  60. $labels = new x_axis_labels();
  61.  
  62. $labels->text('#date: jS, M Y#');                      // tell the labels to render the number as a date:
  63. $labels->set_steps(86400);                             // setting each day as a step
  64. $labels->visible_steps(1);                              // only display every other label (every other day)
  65. //$labels->set_size(20);
  66. $labels->rotate(60); 
  67. //$labels->set_labels($data_4);                      // setting date array as label
  68.  
  69. $x->set_labels($labels);                            // finally attach the label definition to the x axis  
  70.  
  71. //*****setting Y-axis labels
  72.  
  73.  
  74. $y = new y_axis();
  75. $y->set_range( 0, 400, 50); // Y-axis points to set
  76. $colour = '#FFFFFF';
  77. $chart_1 = new open_flash_chart();                   // creating open flash chart object
  78. //$chart_1->set_title( new title( $uname ) );        // setting title
  79. $chart_1->set_bg_colour( $colour );
  80. $chart_1->set_x_axis( $x );
  81. $chart_1->set_y_axis( $y );
  82.  
  83. // here we add our data sets to the chart:
  84. $chart_1->add_element( $line_dot );
  85. $chart_1->add_element( $line_hollow );
  86. $chart_1->add_element( $line );
  87.  
  88.  echo $chart_1->toPrettyString();   
  89.  
  90.  
Here in chart i am getting all values on y-axis only.
Lines are not getting displayed

Can you help please??
Jun 10 '10 #1
1 2586
The x-value of your data should correspond to the x_axis values set by
Expand|Select|Wrap|Line Numbers
  1. $x->set_range(
  2.     mktime(0, 0, 0, 6, 1, date('Y')),    // <-- min
  3.     mktime(0, 0, 0, 6, 16, date('Y'))    // <-- max
  4.     );
  5. $x->set_steps(86400);
  6.  
You should consider revising how your data values are declared:
Expand|Select|Wrap|Line Numbers
  1. for($i = 0; $i < ARRAY_VALUE_COUNT; $i++) { //these arrays are declared above
  2.     $x = mktime(0, 0, 0, 6, ($i + 1), date('Y'));
  3.     $data_1[] = new scatter_value($x, intval($disf[$i]));
  4.     $data_2[] = new scatter_value($x, intval($af[$i]));
  5.     $data_3[] = new scatter_value($x, intval($inf[$i]));
  6.     $data_4[] = $logindate[$i];
  7. }
  8.  
Oct 11 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Guest | last post by:
Hi All, I have to display xml Data in Treeview also after selecting node the data in it display in RichTextBox. Can anyone help me with this. Thanks, Shailes
9
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There...
1
by: Nedu N | last post by:
i want to display actual XML data (with tags & data) from a table's colum (XML data) in a datagrid's column... by default it shows only yhe content of the XML but not the tags...anyone have an...
2
by: Nedu N | last post by:
Hi, I want to display the XML tags (for the the XML tags is the data that is stored in a table) on the datagrid using the datasets. But since the data itself is the XML tag it doesn't appera on...
1
by: thf | last post by:
Hi, I wish to know how to display a collection of object which is a property in another object in a data grid in VB.Net. For example, I'm displaying a collection of vendor objects (in ArrayList)...
2
by: GS | last post by:
Hello- Im new to PHP. I am looking for a link or help on how to set the mime type in my php script as well as send binary data to the browser window instead of having it ask me to save the...
5
by: L C | last post by:
Hello, Could someone point in the correct direction with regards to displaying my data in "nicer" format. I have figured out ( with the tutorials on the web, and the O'Reilly PHP & MySQL book)...
1
by: harikakumar | last post by:
plz anyone knoe about displaying data in excel files using c# on command prompt thats using console application help me
2
by: Seth | last post by:
I am doing a project with a embedded processor. I have a program that can take the data from the serial port and send it out a tcp port of my choosing. I want to be able to read that stream and...
3
by: minimalPixel | last post by:
Hi All, Sorry for the noob question, but hopefully this is an easy one. I'm not exactly sure if this is a php or a mysql question, but I'm working with a component in Joomla's backend that...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.