I am trying to make a web page that displays a graph about the netapp filer usage.
I read the data from the file which is stored in the following fashion
Name usedSpace available_space kbytes quota_volume capacity
Juno 889347800 1795006760 2684354560 1698693120 33%
This is my Perl code
use CGI;
use Time::Local;
use List::MoreUtils qw(uniq);
use GD;
use GD::Graph::bars;
use GD::Graph::lines;
use GD::Graph::area;
open (MYFILE, 'my_data.csv');
@filesystem_name = ();
@my_date = ();
@my_used = ();
@my_avail = ();
@my_kbytes = ();
@my_quota_volume = ();
@my_capacity = ();
#read all the data and store fields into arrays
while (<MYFILE>) {
if(/$user_selected_filer/) {
($dummy,$current_line_date,$dummy,$dummy,$dummy,$dummy,$dummy) = split (/,/, $_);
if(($current_line_timestamp ge $start && $current_line_timestamp le $end)){
($name,$date_after,$used,$avail, $kbytes, $quota_volume, $capacity) = split (/,/, $_);
($month_after,$day_of_month_after,$year_after) = split ('/', $date_after);
push (@filesystem_name,$name);
push (@my_used,$used/1000000);
push (@my_avail,$avail/1000000);
push (@my_kbytes,$kbytes/1000000);
push (@my_quota_volume,$quota_volume/1000000);
push (@my_capacity,$capacity);
push (@my_date_after, $month_after . "/" . $day_of_month_after . "/" . $year_after);
$count++;
}
}
}
These arrays are good for making graphs using Perl as long as I am using GD graphs. But I want to do these graphs on a web page which requires JavaScript arrays.
I am kinda lost with this whole JSON thing.
,, your data is <tab> separated (or spaces?) so don't saying about it usefulness... Why didn't show 1.) your REAL input, 2.) the WANTED output 3.) your REAL actual tryings?!