Page 2 of 6

Re: GraphPlus

Posted: Tue Jun 01, 2021 1:58 pm
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. :)

Re: GraphPlus

Posted: Tue Jun 01, 2021 4:22 pm
by franco
Thank you Rathi .

Re: GraphPlus

Posted: Wed Jun 02, 2021 8:49 am
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 :?:

Re: GraphPlus

Posted: Wed Jun 02, 2021 10:02 am
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.

Re: GraphPlus

Posted: Thu Jun 03, 2021 4:03 am
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 53727 times
Theme1.jpg
Theme1.jpg (10.02 KiB) Viewed 53727 times
Theme2.jpg
Theme2.jpg (12.86 KiB) Viewed 53727 times
Theme3.jpg
Theme3.jpg (12.08 KiB) Viewed 53727 times
Theme4.jpg
Theme4.jpg (14.24 KiB) Viewed 53727 times
For monochrome themes they have used the same colors as above.

Again, thanks for your interest!

Re: GraphPlus

Posted: Thu Jun 03, 2021 4:08 am
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!

Re: GraphPlus

Posted: Thu Jun 03, 2021 7:03 am
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.

Re: GraphPlus

Posted: Thu Jun 03, 2021 4:16 pm
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 276 times
graphplus08.png
graphplus08.png (12.75 KiB) Viewed 53681 times
graphplus07.png
graphplus07.png (21 KiB) Viewed 53677 times
graphplus06.png
graphplus06.png (21.68 KiB) Viewed 53681 times

Re: GraphPlus

Posted: Thu Jun 03, 2021 4:40 pm
by Rathinagiri
Modified the code and my post. Please update if you have downloaded. (forgot to include bar chart labels).

Re: GraphPlus

Posted: Thu Jun 03, 2021 6:56 pm
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.