View unanswered posts | View active topics It is currently Fri Mar 29, 2024 9:36 am



Reply to topic  [ 1 post ] 
Class Constants? 
Author Message
New pChart user
New pChart user

Joined: Fri Dec 16, 2011 11:51 pm
Posts: 1
Post Class Constants?
I'm new to using pChart (and PHP), so perhaps there is a sound reason for the following:

I would like to wrap much of the class instances / graph creation method calls in a predefined function, but I obviously need to call that function and pass it arguments to help define the resulting graph.
e.g.:

Code:
function graphMulti(array $DataArray = NULL, $PlotMultiX = TRUE, $PlotMultiY = FALSE, $FormatX=pData::AXIS_FORMAT_TIME)


As you can see, I was planning on calling the AXIS_FORMAT_TIME class constant, only to find that it isn't defined as a class constant:

pData class definition:
Code:
/* Axis configuration */
define("AXIS_FORMAT_DEFAULT"      , 680001);
define("AXIS_FORMAT_TIME"      , 680002);
define("AXIS_FORMAT_DATE"      , 680003);
define("AXIS_FORMAT_METRIC"      , 680004);
define("AXIS_FORMAT_CURRENCY"      , 680005);
define("AXIS_FORMAT_CUSTOM"      , 680006);


Is there a particular reason why the above constant definitions in the pData class are not defined as:
Code:
/* Axis configuration */
const AXIS_FORMAT_DEFAULT = 680001;
const AXIS_FORMAT_TIME = 680002;
const AXIS_FORMAT_DATE = 680003;
const AXIS_FORMAT_METRIC = 680004;
const AXIS_FORMAT_CURRENCY = 680005;
const AXIS_FORMAT_CUSTOM = 680006;



Thanks!

-Joe


Sat Dec 17, 2011 12:10 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 7 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:  
cron