PureBasic Forum
https://www.purebasic.fr/english/

[Module] Chart - Gadget
https://www.purebasic.fr/english/viewtopic.php?f=27&t=73000
Page 2 of 6

Author:  diskay [ Tue Jun 18, 2019 12:54 pm ]
Post subject:  Re: [Module] Chart - Gadget

Refer to the code here :)
https://github.com/mity/mctrl
Image

Author:  zikitrake [ Tue Jun 18, 2019 1:01 pm ]
Post subject:  Re: [Module] Chart - Gadget

Thorsten1867 wrote:
A chart with horizontal bars and a line chart are planned.
Yeah!

Author:  Thorsten1867 [ Tue Jun 18, 2019 3:00 pm ]
Post subject:  Re: [Module] Chart - Gadget

Update: Bar Chart with horizontal bars

Image

Author:  Thorsten1867 [ Tue Jun 18, 2019 3:13 pm ]
Post subject:  Re: [Module] Chart - Gadget

diskay wrote:
Refer to the code here :)
https://github.com/mity/mctrl

Nice, but only for Windows.
My module should also work under MacOS and Linux. :D

Author:  zikitrake [ Tue Jun 18, 2019 10:40 pm ]
Post subject:  Re: [Module] Chart - Gadget

Could you check why vertical axis values are duplicated?

I am using Example 1 (automatically adjust maximum value), but it happens exactly the same with other examples and using the attribute 'Chart::#Maximum'

Image

Thank you!

Author:  Thorsten1867 [ Wed Jun 19, 2019 10:41 am ]
Post subject:  Re: [Module] Chart - Gadget

Update: Line Chart

Image

@zikitrake
Bug fixed

Author:  zikitrake [ Wed Jun 19, 2019 2:15 pm ]
Post subject:  Re: [Module] Chart - Gadget

Thorsten1867 wrote:
Update: Line Chart

Image

I love you!! :D
Thorsten1867 wrote:
@zikitrake
Bug fixed
Very much!

Author:  Thorsten1867 [ Wed Jun 19, 2019 5:55 pm ]
Post subject:  Re: [Module] Chart - Gadget

@zikitrake
Line charts become really interesting if they are combined with data series. :wink:

Update: Line chart for data series

Image

Author:  zikitrake [ Wed Jun 19, 2019 9:06 pm ]
Post subject:  Re: [Module] Chart - Gadget

Thorsten1867 wrote:
@zikitrake
Line charts become really interesting if they are combined with data series. :wink:
...
Nice! :D

This is really interesting for me, as I plan to add graphics of this style to my project:
Image


Would it be possible to:
- Add an option to hide the labels of the series? (I would put them manually in a List Gadget)
- Invert vertical values from top to bottom? as this image
Image

Really thank you!

Author:  Thorsten1867 [ Thu Jun 20, 2019 1:07 pm ]
Post subject:  Re: [Module] Chart - Gadget

Update:
  • Added: #Hide for hiding legend
  • Addes: #Descending for descending numbering of the y-axis in line charts
  • Bugfixes

Author:  zikitrake [ Thu Jun 20, 2019 1:36 pm ]
Post subject:  Re: [Module] Chart - Gadget

Thorsten1867 wrote:
Update:
  • Added: #Hide for hiding legend
  • Addes: #Descending for descending numbering of the y-axis in line charts
  • Bugfixes

:shock: Yeah, it works like a charm!
Sorry to be so heavy asking for additions but, hey! you're creating a first class module :oops:

Again, thank you so much!

Edit:An issue when #Descendig is activated: Chart::SetAttribute(#Chart, Chart::#Minimum, 1) is ignored :)

Author:  zikitrake [ Thu Jun 20, 2019 3:08 pm ]
Post subject:  Re: [Module] Chart - Gadget

More about previous comented issue

This image is made when #descending is activated and define a Chart::SetAttribute(#Chart, Chart::#Minimum, 1)
Image

I did a change in Procedure DrawLineChart_(), changing
Code:
Range = Maximum - Minimum
to
Code:
If Chart()\Line\Flags & #Descending
  Range = Maximum
Else
   Range = Maximum - Minimum
EndIf

And
Code:
Text$ = Str(Factor * n)
to
Code:
Text$ = Str(Factor * n + Minimum)

Then it seem to works fine
Image

PS: I'm sure my code is a botched job. :lol:

Author:  Thorsten1867 [ Thu Jun 20, 2019 4:31 pm ]
Post subject:  Re: [Module] Chart - Gadget

@ zikitrake
Bug fixed and another little bonus.


Update: Bezier curves for line charts (#BezierCurve)

Image

Author:  zikitrake [ Thu Jun 20, 2019 7:58 pm ]
Post subject:  Re: [Module] Chart - Gadget

Thorsten1867 wrote:
@ zikitrake
Bug fixed and another little bonus.
Update: Bezier curves for line charts (#BezierCurve)

Nice!!!
Image

Author:  zikitrake [ Fri Jun 21, 2019 9:43 am ]
Post subject:  Re: [Module] Chart - Gadget

Turning with the petitions!

- Do you plan to add Tooltips to items? I modified your code (awkwardly) to add a MouseMove event, but it doesn't go very fine :)
Image


- (I don't know whether to consider this a request because I don't know if it will be of general interest :? ) : Could you make a value be hidden when it exceeds the Chart::#Minimum/Chart::#Maximum?

For example, in this graph I have assigned minimum value = 1 and maximum value = 100. When a value exceeds 100 I would like it to be hidden (or show a label 'out' for example :) )
Image

PS: Tomorrow I'm going on a week' holiday, so I'll stop grilling you! :oops:

Page 2 of 6 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/