[Module] Chart - Gadget

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Bug fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Module] Chart - Gadget

Post by Lord »

Thorsten1867 wrote:Bug fixed
Thanks for that.
But now: Example 13
If you click the green data point and then move the mouse, the
data point jumps 3 units below mousepointer.
As result of that, if you drag the point up to maximum of "80",
you can only reach a "76".
If you are going down and come to "0", the data point jumps
to "-1" and you can't reach or select the point anymore.
Image
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Bugs fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: [Module] Chart - Gadget

Post by Lord »

Thorsten1867 wrote:Bugs fixed
Thanks for that.

Again example 15:

Drop down menu entries only work on the small colored symbols,
despite the occurence of the drop menu in the drawing area.
After hiding "Series 3" via drop down, "Display 'Series 3'" doesn't
display these data again. This is true for all data.
Image
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Bugfixes: Code and Example
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
zikitrake
Addict
Addict
Posts: 833
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: [Module] Chart - Gadget

Post by zikitrake »

Hi Thorsten1867, I'm back here to see if you can solve 2 things :)

1º) When the flag Chart::#PostEvents is active (as in example #15) even if you click the left mouse button it always detects #PB_EventType_RightClick EventType()

Image

2º) When I activate the flag Chart::#OutOfRange but I have deactivated the display of values, when a value is out of range it always appears (Whether or not the flag Chart::#OutOfRange is activated)

Image

It would be possible to hide this value (optionally or permanently)

As always, thank you so much for your work (and for reading to me).
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Update: Bugfixes
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
zikitrake
Addict
Addict
Posts: 833
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: [Module] Chart - Gadget

Post by zikitrake »

Thorsten1867 wrote:Update: Bugfixes
:D Thank you. It works fine now!
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] Chart - Gadget

Post by skywalk »

Hi Thorsten1867, this is looking great. 8)
Will you be adding scatter plots? Meaning floating point X's and Y's.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

I've never used a scatterplot before.
Would you perhaps have an example so I can better imagine what the input data looks like?
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Update: Scatter Plot

Image
Last edited by Thorsten1867 on Fri Dec 20, 2019 3:22 pm, edited 1 time in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] Chart - Gadget

Post by skywalk »

Cool, I will check it out. 8)
Scatter plots dominate my many reports.
Line charts/bar graphs are used for paretos, histograms.
Heat maps are the next trick!
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

Update: Flags #Left/#Right for legend added
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
cyril
User
User
Posts: 15
Joined: Sun Feb 23, 2020 4:28 pm

Re: [Module] Chart - Gadget

Post by cyril »

Hello Thorsten1867

I'm trying to use ScatterPlot with date on the X axes and double on the Y axes.
I'm using

Code: Select all

Procedure ChartCreate(x, y, width, height)
  Chart::Gadget(#Gadget_Chart, x, y, width, height, Chart::#ScatterPlot|Chart::#Border|Chart::#ShowLines|Chart::#ToolTips|Chart::#AutoResize, #Window_Main)
  Chart::SetFlags(#Gadget_Chart, Chart::#Legend, Chart::#PostEvents)
  Chart::SetFlags(#Gadget_Chart, Chart::#AxisX, Chart::#Time|Chart::#Labels)
  Chart::SetAttribute(#Gadget_Chart, Chart::#Decimals, 2)
  Chart::SetMask(#Gadget_Chart, Chart::#AxisX, "%dd/%mm/%yyyy")
  Chart::ToolTipText(#Gadget_Chart, Chart::#Scatter$ + ": " + Chart::#Time$ + " - " + Chart::#DataY$ + " kg")
EndProcedure
to create the chart, I'm iterating with

Code: Select all

Define day = Val(Right(ListeWeight()\Date, 2))
Define month = Val(Mid(ListeWeight()\Date, 5, 2))
Define year = Val(Left(ListeWeight()\Date, 4))
Chart::AddScatterItem(#Gadget_Chart, "Weight", WeightList()\Date, Date(year, month, day, 0, 0, 0), WeightList()\Weight)
to add data to the chart. I'm losing the decimals on the Y axis.

It seems that AddScatterItem, takes quad as an argument for X and Y axes, so decimal value are lost.
Is there another way to do it with decimals ?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] Chart - Gadget

Post by Thorsten1867 »

So I have to figure out how I'm gonna do this.

Gesendet von meinem Aquaris X2 mit Tapatalk
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply