HI there,
Need Help...
This is data file's result: -
{ "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 } }
-
This is the code for it: -
{ //these arrays are declared above
-
-
$data_1[] = intval($disf[$i]);
-
$data_2[] = intval($af[$i]);
-
$data_3[] = intval($inf[$i]);
-
$data_4[] = $logindate[$i];
-
-
}
-
-
//***** Purple line
-
-
$default_dot = new dot();
-
//$default_dot->tooltip('#x_label#<br>#val#');
-
$default_dot->tooltip('#val#');
-
$default_dot->size(5)->colour('#DFC329');
-
$line_dot = new line();
-
$line_dot->set_default_dot_style($default_dot);
-
$line_dot->set_width( 2 );
-
$line_dot->set_colour( '0x9933CC' );
-
$line_dot->set_values( $data_1 );
-
$line_dot->set_tooltip('#Hello#');
-
$line_dot->set_key( "DisHonest Follower", 10 );
-
-
//***** Pink line
-
-
$default_hollow_dot = new hollow_dot();
-
$default_hollow_dot->tooltip('#x_label#<br>#val#');
-
$default_hollow_dot->size(5)->colour('#6363AC');
-
-
$line_hollow = new line();
-
$line_hollow->set_default_dot_style($default_hollow_dot);
-
$line_hollow->set_width( 2 );
-
$line_hollow->set_colour( '0xCC3399' );
-
$line_hollow->set_values( $data_2 );
-
$line_hollow->set_key( "ActiveHonest Follower", 10 );
-
-
//***** Green line
-
-
$star = new star();
-
$star->size(5);
-
//$star->set_tooltip("#x_label#<br>#val#");
-
$line = new line();
-
$line_hollow->set_default_dot_style($star);
-
$line->set_width( 2 );
-
$line->set_colour( '0x80a033' );
-
$line->set_values( $data_3 );
-
$line->set_key( "InactiveHonest Follower", 10 );
-
-
//*****create an X Axis object setting X-axis labels
-
$x = new x_axis();
-
// grid line and tick every 10 show ticks and grid lines for every day:
-
// grid line and tick every 10
-
-
$x->set_range(
-
mktime(0, 0, 0, 6, 1, date('Y')), // <-- min
-
mktime(0, 0, 0, 6, 16, date('Y')) // <-- max
-
);
-
$x->set_steps(86400);
-
-
$labels = new x_axis_labels();
-
-
$labels->text('#date: jS, M Y#'); // tell the labels to render the number as a date:
-
$labels->set_steps(86400); // setting each day as a step
-
$labels->visible_steps(1); // only display every other label (every other day)
-
//$labels->set_size(20);
-
$labels->rotate(60);
-
//$labels->set_labels($data_4); // setting date array as label
-
-
$x->set_labels($labels); // finally attach the label definition to the x axis
-
-
//*****setting Y-axis labels
-
-
-
$y = new y_axis();
-
$y->set_range( 0, 400, 50); // Y-axis points to set
-
$colour = '#FFFFFF';
-
$chart_1 = new open_flash_chart(); // creating open flash chart object
-
//$chart_1->set_title( new title( $uname ) ); // setting title
-
$chart_1->set_bg_colour( $colour );
-
$chart_1->set_x_axis( $x );
-
$chart_1->set_y_axis( $y );
-
-
// here we add our data sets to the chart:
-
$chart_1->add_element( $line_dot );
-
$chart_1->add_element( $line_hollow );
-
$chart_1->add_element( $line );
-
-
echo $chart_1->toPrettyString();
-
-
Here in chart i am getting all values on y-axis only.
Lines are not getting displayed
Can you help please??
1 2586
The x-value of your data should correspond to the x_axis values set by -
$x->set_range(
-
mktime(0, 0, 0, 6, 1, date('Y')), // <-- min
-
mktime(0, 0, 0, 6, 16, date('Y')) // <-- max
-
);
-
$x->set_steps(86400);
-
You should consider revising how your data values are declared: -
for($i = 0; $i < ARRAY_VALUE_COUNT; $i++) { //these arrays are declared above
-
$x = mktime(0, 0, 0, 6, ($i + 1), date('Y'));
-
$data_1[] = new scatter_value($x, intval($disf[$i]));
-
$data_2[] = new scatter_value($x, intval($af[$i]));
-
$data_3[] = new scatter_value($x, intval($inf[$i]));
-
$data_4[] = $logindate[$i];
-
}
-
Sign in to post your reply or Sign up for a free account.
Similar topics
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
|
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...
|
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...
|
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...
|
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)...
|
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...
|
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)...
|
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
|
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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
|
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...
| |