View unanswered posts | View active topics It is currently Wed May 08, 2024 1:30 pm



Reply to topic  [ 3 posts ] 
DisplayValues -- Is there a method to skip? 
Author Message
Post DisplayValues -- Is there a method to skip?
Hi there, big fan of this charting class, but I'm having a problem with formatting a spline chart. I can set DisplayValues = true in the format array, but I've yet to find any way to have it skip displaying values, kind of like how LabelSkip works for the X axis. As a result, on a chart with tons of data I get a lot of overlap. Any ideas?


Fri Jan 14, 2011 5:06 pm
Post Re: DisplayValues -- Is there a method to skip?
Implemented the feature myself...

Inside drawSplineChart() (or any other of the draw*Chart functions for that matter:

Right under this: $DisplayValues = isset($Format["DisplayValues"]) ? $Format["DisplayValues"] : FALSE;
Put this: $DisplaySkip = isset($Format["DisplaySkip"]) ? $Format["DisplaySkip"] : 1;

Find this:

if ( $DisplayValues )
$this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));


Change to this:

if ( $DisplayValues ) {
if(($Key % $DisplaySkip) == 0)
$this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
}

The param is called "DisplaySkip" -- works the same way as LabelSkip.


Fri Jan 14, 2011 6:15 pm
Post Re: DisplayValues -- Is there a method to skip?
Whoops, noticed the two DisplayValues conditionals do different things! New instructions...

Right under this: $DisplayValues = isset($Format["DisplayValues"]) ? $Format["DisplayValues"] : FALSE;
Put this: $DisplaySkip = isset($Format["DisplaySkip"]) ? $Format["DisplaySkip"] : 1;

Find this:
if ( $DisplayValues )
$this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));

Change to this:
if ( $DisplayValues ) {
if(($Key % $DisplaySkip) == 0)
$this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
}

Find this:
if ( $DisplayValues )
$this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));

Change to this:
if ( $DisplayValues ) {
if(($Key % $DisplaySkip) == 0)
$this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
}


Fri Jan 14, 2011 6:18 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

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