View unanswered posts | View active topics It is currently Thu Mar 28, 2024 9:31 am



Reply to topic  [ 2 posts ] 
Size of Output Graph 
Author Message
New pChart user
New pChart user

Joined: Tue Feb 08, 2011 6:01 pm
Posts: 2
Post Size of Output Graph
I had a contractor working on a customized pchart for me. He has abandoned the project and left me with an uncomplete solution. The biggest issue i have right now is the size output of the graph. First off the aspect ratio is off, secondly I'll need to resize the graph for different output.

First Question: I am assuming that I need to change every coordinate and adjust everything to get to a final aspect ration i want. It appears that each part of the graph is creating using a coordinate that probably relates to the original size selected in the first object creation. Is this correct?

Second: Once I do get the aspect ration correct is there a scaling function to change the output size of the graph - or do I have to go through all adjustments again to output a different sized graph.

Example.. the original graph as he gave it to me was 700x300. I need something more like 600x500. Once that aspect ratio is right i may want to increase the size to say 1200x1000 easily.

Any advice?


Tue Feb 08, 2011 6:05 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Size of Output Graph
There is no auto-layout functions in the pChart library meaning you have to provide the position of each elements that will be drawn.

If you take a look at the sandbox engine, you'll notice that depending of the size of the chart, the elements will be repositioned automatically (if you keep the "Automatic positioning of the elements" option checked). I believe that you'll have to do something using the same philosophy :

1. Define the size of your chart.
2. Compute the position and size of the chart area.
3. Use the pChart internal function to get the projected size of the next elements:

- getLegendSize() for the projected size of the legend box.
- getTextBox() for the projected size of text strings (or the result of the drawText() function)

This way you can re-compute the position & size of each elements for any target resolution.

Only caveat, this does not support re-sizing of the text elements, you'll have to find your own ration here.

Kind regards,
JD.


Wed Feb 09, 2011 11:34 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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