GraphPlus

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GraphPlus

Post by Rathinagiri »

Cool Grigory Filatov.

I have though about that.

However I have chosen the current logic, for having monochrome theme of Office 365.

Anyway, included your code for the next version. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: GraphPlus

Post by franco »

Thank you Rathi .
All The Best,
Franco
Canada
User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GraphPlus

Post by gfilatov »

Rathinagiri wrote: Tue Jun 01, 2021 1:58 pm Cool Grigory Filatov.

I have though about that.

However I have chosen the current logic, for having monochrome theme of Office 365.

Anyway, included your code for the next version. :)
Hi Rathi,

I've prepared also the following header file for the GraphPlus library:
/*
MINIGUI - Harbour Win32 GUI library

Copyright 2002-2010 Roberto Lopez <harbourminigui@gmail.com>
http://harbourminigui.googlepages.com

Author: S.Rathinagiri <rathinagiri@sancharnet.in>
*/

/* Legend position */
#define LEGEND_ON_RIGHT 0
#define LEGEND_ON_BOTTOM 1

/* Graph type */
#define GT_DEFAULT 1
#define GT_COLUMNS 1
#define GT_LINE 2
#define GT_POINTS 3
#define GT_PIE 4
#define GT_BAR 5

/* Color theme */
#define THEME_1 1
#define THEME_2 2
#define THEME_3 3
#define THEME_4 4

/* Colors */
#define CLR_HAVELOCK_BLUE { 68 , 115 , 197 }
#define CLR_WESTSIDE { 237 , 125 , 49 }
#define CLR_LIGHT_GREY { 165 , 165 , 165 }
#define CLR_DARK_YELLOW { 253 , 193 , 1 }
#define CLR_PICTON_BLUE { 91 , 155 , 213 }
#define CLR_APPLE { 112 , 173 , 71 }

#define CLR_DARK_GREY { 99 , 99 , 99 }
#define CLR_ENDEAVOUR { 37 , 95 , 145 }
#define CLR_SADDLE_BROWN { 160 , 71 , 13 }
#define CLR_DELL { 66 , 104 , 43 }

#define CLR_LIGHT_BROWN { 152 , 115 , 0 }
#define CLR_DARKER_BLUE { 38 , 68 , 120 }
I have a problem with a Color themes naming :?

What is your opinion :?: Is it useful :?:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
RPC
Posts: 281
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF

Re: GraphPlus

Post by RPC »

Hi Rathi
Thanks for GraphPlus.
Just one suggestion. When we swith rows and colums the legend 'period' goes to y-axis.
I think it should remain on x-axis. Below 'Sales' and 'Profit' figure.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GraphPlus

Post by Rathinagiri »

gfilatov wrote: Wed Jun 02, 2021 8:49 am
Rathinagiri wrote: Tue Jun 01, 2021 1:58 pm Cool Grigory Filatov.

I have though about that.

However I have chosen the current logic, for having monochrome theme of Office 365.

Anyway, included your code for the next version. :)
Hi Rathi,

I've prepared also the following header file for the GraphPlus library:
/*
MINIGUI - Harbour Win32 GUI library

Copyright 2002-2010 Roberto Lopez <harbourminigui@gmail.com>
http://harbourminigui.googlepages.com

Author: S.Rathinagiri <rathinagiri@sancharnet.in>
*/

/* Legend position */
#define LEGEND_ON_RIGHT 0
#define LEGEND_ON_BOTTOM 1

/* Graph type */
#define GT_DEFAULT 1
#define GT_COLUMNS 1
#define GT_LINE 2
#define GT_POINTS 3
#define GT_PIE 4
#define GT_BAR 5

/* Color theme */
#define THEME_1 1
#define THEME_2 2
#define THEME_3 3
#define THEME_4 4

/* Colors */
#define CLR_HAVELOCK_BLUE { 68 , 115 , 197 }
#define CLR_WESTSIDE { 237 , 125 , 49 }
#define CLR_LIGHT_GREY { 165 , 165 , 165 }
#define CLR_DARK_YELLOW { 253 , 193 , 1 }
#define CLR_PICTON_BLUE { 91 , 155 , 213 }
#define CLR_APPLE { 112 , 173 , 71 }

#define CLR_DARK_GREY { 99 , 99 , 99 }
#define CLR_ENDEAVOUR { 37 , 95 , 145 }
#define CLR_SADDLE_BROWN { 160 , 71 , 13 }
#define CLR_DELL { 66 , 104 , 43 }

#define CLR_LIGHT_BROWN { 152 , 115 , 0 }
#define CLR_DARKER_BLUE { 38 , 68 , 120 }
I have a problem with a Color themes naming :?

What is your opinion :?: Is it useful :?:
That is so kind of you Grigory! I thought to create such a header file later. But, you created and helped a lot! Thanks a lot.

I have used the same colors and themes as in Office 365. That is why problem with naming.

I hereby give the screenshots of MS Excel from where I have taken the colors. Hope it is useful!
colors1.jpg
colors1.jpg (35.25 KiB) Viewed 48533 times
Theme1.jpg
Theme1.jpg (10.02 KiB) Viewed 48533 times
Theme2.jpg
Theme2.jpg (12.86 KiB) Viewed 48533 times
Theme3.jpg
Theme3.jpg (12.08 KiB) Viewed 48533 times
Theme4.jpg
Theme4.jpg (14.24 KiB) Viewed 48533 times
For monochrome themes they have used the same colors as above.

Again, thanks for your interest!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GraphPlus

Post by Rathinagiri »

RPC wrote: Wed Jun 02, 2021 10:02 am Hi Rathi
Thanks for GraphPlus.
Just one suggestion. When we swith rows and colums the legend 'period' goes to y-axis.
I think it should remain on x-axis. Below 'Sales' and 'Profit' figure.
Thanks a lot! Yes you are correct! Actually, it is meaningless to add the title there. So, I have removed the titles. If required, we can add manually before drawing!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GraphPlus

Post by gfilatov »

Rathinagiri wrote: Thu Jun 03, 2021 4:08 am ...
So, I have removed the titles. If required, we can add manually before drawing!
Hi Rathi,

I've added also the following modifications:
- fixed the values percent calculation in the Pie graph;
- updated the centering of a graph title taking into account
the width of the legend at right;
- added the legend's centering in a bottom position.
My results and updated source are attached.
Attachments
graphplus06.png
graphplus06.png (14.25 KiB) Viewed 48518 times
graphplus05.png
graphplus05.png (20.92 KiB) Viewed 48518 times
graphplus04.png
graphplus04.png (15.56 KiB) Viewed 48518 times
graphplus03.png
graphplus03.png (24.09 KiB) Viewed 48518 times
graphplus02.png
graphplus02.png (19.7 KiB) Viewed 48518 times
graphplus01.png
graphplus01.png (24.18 KiB) Viewed 48518 times
GraphPlus-Upd.zip
(7.28 KiB) Downloaded 104 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GraphPlus

Post by Rathinagiri »

Thank you Grigory. Merged your code.

Added the following features:
- New Graph Type Bar
- New Graph Type Funnel
- Pie Chart in clockwise (Previous pie chart was drawn in anti-clockwise which was awkward)
- Fixed many bugs and inefficient code
GraphPlus_2021_06_03.zip
(11.63 KiB) Downloaded 106 times
graphplus08.png
graphplus08.png (12.75 KiB) Viewed 48487 times
graphplus07.png
graphplus07.png (21 KiB) Viewed 48483 times
graphplus06.png
graphplus06.png (21.68 KiB) Viewed 48487 times
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: GraphPlus

Post by Rathinagiri »

Modified the code and my post. Please update if you have downloaded. (forgot to include bar chart labels).
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
gfilatov
Posts: 1060
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GraphPlus

Post by gfilatov »

Rathinagiri wrote: Thu Jun 03, 2021 4:16 pm Added the following features:
- New Graph Type Bar
- New Graph Type Funnel
- Pie Chart in clockwise (Previous pie chart was drawn in anti-clockwise which was awkward)
- Fixed many bugs and inefficient code
Hi Rathi,

Thanks a lot :!:

Please take a look for my small corrections:
- fixed warnings at compiling with the Harbour switch -w2;
- swapped output order for legends and title for calculate the correct :nLegendWidth size;
- updated color definition of the YELLOW color in the header file GraphPlus.ch.
Attachments
GraphPlus-Upd-2.zip
(9.63 KiB) Downloaded 109 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
Post Reply