View unanswered posts | View active topics It is currently Sun Jul 21, 2024 11:59 pm

Reply to topic  [ 1 post ] 
Draw a chart with fixed x-axis limits with type time 
Author Message
New pChart user
New pChart user

Joined: Sat Jan 11, 2014 6:25 pm
Posts: 1
Post Draw a chart with fixed x-axis limits with type time

I want to plot measured temperature for a whole day with a reset on midnight.
I would like to have the x-axis always starting at midnight and ending at midnight.
I get my data from a csv file with the following example content:

11.01.2014, 00:00, 20.062
11.01.2014, 00:15, 20.125
11.01.2014, 00:30, 20.062
11.01.2014, 00:45, 20.062
11.01.2014, 01:00, 20.125

I ignore the first column and plot with the following code:

error_reporting (E_ALL | E_STRICT);
ini_set ('display_errors' , 1);

$myData = new pData();

$myData->setAxisUnit(0," °C");

$myPicture = new pImage(800,600,$myData,TRUE);


$TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE
, "R"=>0, "G"=>0, "B"=>0);

$Settings = array("Pos"=>SCALE_POS_LEFTRIGHT
, "ManualScale"=>array(1=>array("Min"=>0,"Max"=>24),0=>array("Min"=>16,"Max"=>23))
, "LabelingMethod"=>LABELING_ALL
, "GridR"=>255, "GridG"=>255, "GridB"=>255, "GridAlpha"=>50, "TickR"=>0, "TickG"=>0, "TickB"=>0, "TickAlpha"=>50, "LabelRotation"=>0, "LabelSkip"=>15, "CycleBackground"=>1, "DrawXLines"=>1, "DrawYLines"=>ALL);

$Config = array("ForceTransparency"=>100);


Where can I make it work like I want?

Sorry, I am quite new to pChart. Perhaps my code is not the best ;)

Sat Jan 11, 2014 6:32 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: