Current location: Hot Scripts Forums » Programming Languages » PHP » jpGraph axis labeling problem


jpGraph axis labeling problem

Reply
  #1 (permalink)  
Old 08-20-03, 05:25 AM
Squeezer's Avatar
Squeezer Squeezer is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Luxembourg
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Question jpGraph axis labeling problem

Hello

I've written an fund market stock plotter using JpGraph, and I'me faceing a problem with the labeling (TextTicks) of the Y axis! To show you what I mean, I give you the example of the wrong chart:
http://www.giombetti.com/demo_graph.gif

I always want exactely 3 values to be displayed on the Y axis for labeling! (So that there will also be 3 Y grid lines) In the image I posted, there are only 2 values on the Y axis, because jpGraph "autochooses" the number of Ticks on the Y axis!

How can I fixe this problem?

Anyone an idea?

Thanks for your help

Yours sincerely
Marc Giombetti
__________________
Marc Giombetti - PHP Programmer
marc@giombetti.com
http://www.giombetti.com
Luxembourg - Europe

Last edited by Squeezer; 08-21-03 at 10:51 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-20-03, 08:41 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Can you post the code that you use to generate the image ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-20-03, 08:53 AM
Squeezer's Avatar
Squeezer Squeezer is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Luxembourg
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Hello

well this isn't the entire code but only the code to generate the graph!
the queries to the database tables were removed!
but the queries return the following values
$datavalues --> The evaluation values of the chart

The fake values (i add) is an array containing values that are continously 0! This array is also a line plot but not in the visible scope of the graph! I use this trick to prevent the graph from autoscaling horizontaly (if i wouldn't do this the graph would be spread over the entire width, even if there were only some values)

PHP Code:

<?php

$graph
->SetScale("textlin"$intra_down$intra_top);
$graph->SetFrame(true"$bgcolor");
$graph->SetMargin(27550);

$graph->SetMarginColor("$bgcolor");
$graph->SetColor("$bgcolor");

$graph->yaxis->HideZeroLabel();
$graph->yaxis->SetColor("$axiscolor");
$graph->yaxis->SetLabelmargin(2);
$graph->yaxis->scale->SetAutoMin($intra_down);
$graph->yaxis->scale->SetAutoMax($intra_top);
$graph->yaxis->HideTicks(true);

$graph->xaxis->SetColor("$axiscolor");

$graph->xaxis->SetTextTickInterval($interval);
$graph->xaxis->SetLabelmargin(1);
// grid config
$graph->xgrid->SetColor("$gridcolor");
$graph->ygrid->SetColor("$gridcolor");
$graph->xgrid->Show();
$graph->ygrid->Show();
// Create the first line
if ($drawfake == "true") {
    
// create the second line plot
    
$p2 = new LinePlot($fakearray);
    
$graph->Add($p2);


$p1 = new LinePlot($datavalues);
$p1->SetColor("$globalcolor");
// $p1->SetFillColor("$fillupcolor");
$p1->SetStyle('solid');
$p1->SetWeight(1);

$graph->Add($p1);

$graph->Stroke();
?>
__________________
Marc Giombetti - PHP Programmer
marc@giombetti.com
http://www.giombetti.com
Luxembourg - Europe

Last edited by Squeezer; 08-21-03 at 10:50 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file download problem ukyankee Perl 6 10-04-03 11:39 PM


All times are GMT -5. The time now is 01:18 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.