Problem with DrawBarGraph

Moderator: Rathinagiri

chrisjx2002
Posts: 192
Joined: Wed Jan 06, 2010 5:39 pm

Re: Problem with DrawBarGraph

Post by chrisjx2002 »

You are right. It will be better in that way.
chrisjx2002
Posts: 192
Joined: Wed Jan 06, 2010 5:39 pm

Re: Problem with DrawBarGraph

Post by chrisjx2002 »

I have made some changes in the h_graph.prg module. You will find attached the new module and a screenshot.
Attachments
Graph.jpg
Graph.jpg (57.59 KiB) Viewed 3818 times
h_graph.zip
(7.07 KiB) Downloaded 223 times
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Problem with DrawBarGraph

Post by srvet_claudio »

chrisjx2002 wrote:I have made some changes in the h_graph.prg module. You will find attached the new module and a screenshot.
Please explain changes and the improvements in the code and in the graph.
Best regards,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
chrisjx2002
Posts: 192
Joined: Wed Jan 06, 2010 5:39 pm

Re: Problem with DrawBarGraph

Post by chrisjx2002 »

The modifications are :

- boundaries of the graph are now 31 and 30 instead of 16 and 15 in order to be able to print graph for days of a month. I don't test this program with higher values.
- the show yLabels is changed in order to print the ylabels in the middle of the bars section (I have add a small modification in the h-graph.prg file in order to make this modification only for bars and not for lines or points)
- The section if nType == BARS is changed for the nPos value which was wrong

I put back in the file enclosed the value like nRes,... even if there are not used for the moment.

And don't hesitate to test it.... ;)

Feel free to ask me for more questions if necessary.
Attachments
h_graph.zip
(7.16 KiB) Downloaded 241 times
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Problem with DrawBarGraph

Post by Pablo César »

I put back in the file enclosed the value like nRes,... even if there are not used for the moment.
What do you think if yourself can make nRes useable ? Would it be great ! :)
chrisjx2002 wrote:And don't hesitate to test it.... ;)

Feel free to ask me for more questions if necessary.
Hi Chris, thank you for your big interest and efforts for improving this ressource and sample. I think is the only way to improve something when we give place to others for comments and making questions.

I am still in doubts with mathematical definitions about sizes and postioning. At your last picture shows all bars have passed to the vertical cordinates lines. See here in red/margenta color with arrow where it should not exceed:
Graph.PNG
Graph.PNG (125.49 KiB) Viewed 3758 times
My another suggestion is to take same example and post with this your source code improved, just we can test it without re-building lib. This will help a lot.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
chrisjx2002
Posts: 192
Joined: Wed Jan 06, 2010 5:39 pm

Re: Problem with DrawBarGraph

Post by chrisjx2002 »

The magenta line is not linked to the back side of the bar but to the front side then it is correct (3D effect).

You will find attached the example including the h-graph module. Then it is not necessary to rebuild the lib.

I don't know exactly what is the nRes parameter. To activate it needs some tests. I try that when I will have enough time... not simple...
Attachments
demobar.zip
(7.61 KiB) Downloaded 247 times
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Problem with DrawBarGraph

Post by Pablo César »

Good to make PRG file sample without rebuilding lib. :)

I still insist to see my previous image of graph:

Image

You will see first block (january) accompany persperctive, is inclined and the end of first block ends at second vertical line as start a new month.

The second block in your image starts exactly on the second vertical line. And IMO should be starts before, keeping the persperctive alined.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply