View unanswered posts | View active topics It is currently Sat Apr 27, 2024 4:48 pm



Reply to topic  [ 8 posts ] 
Remove axis Y 
Author Message
New pChart user
New pChart user

Joined: Wed Nov 30, 2011 2:28 am
Posts: 1
Post Remove axis Y
Hi!
I have a graphic of dual-axis. I want to remove the axis Y.

Exists "RemoveXAxis", I need something as "RemoveYAxis".,.

Thks


Attachments:
File comment: Grafico
graphics.jpg
graphics.jpg [ 16.58 KiB | Viewed 14952 times ]
Wed Nov 30, 2011 2:55 am
Profile
New pChart user
New pChart user

Joined: Fri Apr 06, 2012 2:42 pm
Posts: 3
Post Re: Remove axis Y
Hi,

did you find a workaround for this?

Also interested in removing the Y axis.


thanks
Alex


Tue Apr 10, 2012 7:59 am
Profile
New pChart user
New pChart user

Joined: Wed Jul 18, 2012 9:06 am
Posts: 2
Post Re: Remove axis Y
I've got the same problem. Sometimes it just doesn't make sense to show the Axis.

Here is the list of options that I'm are currently missing (or I haven't found):
  • Hide Y-Axis (Axis 0; StackedBarChart)
  • Possibility to skip scale values or possibility (there is LabelSkip but I need to for the automatically calculated scale values; see http://wiki.pchart.net/doc.doc.draw.scale.html) OR
  • Possibility to manually set the min and max value together with the a skip/range value (example: ("MinScaleVal"=>0,"MaxScaleVal"=>100,"Each"=>20) which would add the scale values 0, 20, 40, 60, 80, 100 to the Axis)
  • With 'SCALE_MODE_ADDALL_START0' for the StackedBarChart I can start with 0 but I would like to let it stop a 100 not 105 (automatically calculated) which displayed now (see attached example image).

The above is required for the StackedBarChart (normalized to 100% or not).
Here is an example where I would like to get rid of the Label displaying the ranges (0...105) completely or at least remove most of the displayed intermediate values.
The values are normalized to 100 but I didn't add "%" to the second parameter of the normalize function...otherwise the values would be 0%, 5%, 10%, etc. with the result that the text would be printed over each other (similar but worse then for the axis value 100 and 105).
Attachment:
simple_bar_chart.png
simple_bar_chart.png [ 29.16 KiB | Viewed 14712 times ]


Wed Jul 18, 2012 10:26 am
Profile
New pChart user
New pChart user

Joined: Wed Jul 18, 2012 1:52 pm
Posts: 2
Post Re: Remove axis Y
It's possible to use setAxisDisplay() if you use a custom function as the "Format" parameter that prints an empty string, such as: function YAxisFormat() { return ""; }

This removes the Y-axis lables but also the values on the bars/lines which is not too good. Definitely need a function to remove the Y-axis labels but not the chart labels.


Wed Jul 18, 2012 3:28 pm
Profile
New pChart user
New pChart user

Joined: Thu May 10, 2012 10:56 am
Posts: 2
Post Re: Remove axis Y
There is a workaround - you can cover the Y axis with a white rectangle... use function "drawFilledRectangle" ...


Last edited by Kozuch on Thu May 16, 2013 8:59 pm, edited 1 time in total.



Wed Oct 31, 2012 3:31 pm
Profile
New pChart user
New pChart user

Joined: Thu May 16, 2013 5:43 pm
Posts: 1
Post Re: Remove axis Y
Hi

in pDraw.class.php

add after line 1746 :
Code:
     $RemoveYAxis   = isset($Format["RemoveYAxis"]) ? $Format["RemoveYAxis"] : FALSE;


and modify line 2291
Code:
if ( $Parameters["Identity"] == AXIS_Y && !$RemoveYAxis )


now you have a new format parameter to display or not Y axis :)


Thu May 16, 2013 5:46 pm
Profile
New pChart user
New pChart user

Joined: Mon Jul 22, 2013 4:53 pm
Posts: 1
Post Re: Remove axis Y
@nsilberman - many many thanks. That worked beautifully. The line numbers did not match on my version - but a little search got me there.

I though had a slightly different need. "RemoveYAxis" removes the Y-lines also. And that I did not want. So I also added a custom parameter "SuppressYAxisValues" and followed your chain of thought. Voila ! I now have a graph with the grid intact, but the YAxis values not shown.

Can upload the code in case someone needs it.

Best Regards,
Dipan


Mon Jul 22, 2013 5:00 pm
Profile
New pChart user
New pChart user

Joined: Fri Aug 09, 2013 11:00 pm
Posts: 1
Post Re: Remove axis Y
dipan66 wrote:
@nsilberman - many many thanks. That worked beautifully. The line numbers did not match on my version - but a little search got me there.

I though had a slightly different need. "RemoveYAxis" removes the Y-lines also. And that I did not want. So I also added a custom parameter "SuppressYAxisValues" and followed your chain of thought. Voila ! I now have a graph with the grid intact, but the YAxis values not shown.

Can upload the code in case someone needs it.

Best Regards,
Dipan


Hello,

And have the same problem, so could you upload here the code you use to remove YAxis Values?

Thank you.


Fri Aug 09, 2013 11:01 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

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