[Module] Chart - Gadget (vers. Diagramme)

Hier könnt Ihr gute, von Euch geschriebene Codes posten. Sie müssen auf jeden Fall funktionieren und sollten möglichst effizient, elegant und beispielhaft oder einfach nur cool sein.
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

[Module] Chart - Gadget (vers. Diagramme)

Beitrag von Thorsten1867 »

Chart Gadget - Module (all OS / 64Bit / DPI)

Erzeugen von Säulen-, Balken, Torten- und Kurvendiagrammen, Streudiagramm, sowie Diagramme mit Datenreihen:
  • Unterstützung von positiven und negativen Werten
  • automatische Berechnung der Balkenbreite (#PB_Default) und des Abstandes (#PB_Default) möglich
  • automatische Anpassung des Maximalwertes (#PB_Default) möglich
  • Anzeige von horizontalen Linien (Y-Achse) möglich
  • Anzeige von Werten, Prozenten oder Text im (bzw. über dem) Balken möglich
  • Unterstützung von Links-, Rechts- oder Doppelklick Events für Balken
  • automatische Größenanpassung des Gadgets
Bild

Code: Alles auswählen

; Chart::AddItem()             - similar to AddGadgetItem()
; Chart::AttachPopupMenu()     - attachs a popup menu to the chart
; Chart::DisableReDraw()       - disable/enable redrawing
; Chart::EventColor()          - returns the color after the event
; Chart::EventIndex()          - returns the item index after the event
; Chart::EventLabel()          - returns the item label after the event
; Chart::EventValue()          - returns the item value after the event
; Chart::Gadget()              - create a new gadget
; Chart::GetErrorMessage()     - get error message [DE/FR/ES/UK]
; Chart::GetItemColor()        - returns the color of the item
; Chart::GetItemLabel()        - get the label of the item
; Chart::GetItemState()        - similar to GetGadgetItemState()
; Chart::GetItemText()         - similar to GetGadgetItemText()
; Chart::GetLabelState()       - similar to GetGadgetItemState(), but 'label' instead of 'position'
; Chart::GetLabelColor()       - returns the color of the item
; Chart::RemoveItem()          - similar to RemoveGadgetItem()
; Chart::RemoveLabel()         - similar to RemoveGadgetItem(), but 'label' instead of 'position'
; Chart::SetAttribute()        - similar to SetGadgetAttribute()
; Chart::SetAutoResizeFlags()  - [#MoveX|#MoveY|#ResizeWidth|#ResizeHeight]
; Chart::SetColor()            - similar to SetGadgetColor()
; Chart::SetFlags()            - set flags for chart customization
; Chart::SetFont()             - similar to SetGadgetFont()
; Chart::SetItemState()        - similar to SetGadgetItemState()
; Chart::SetItemText()         - similar to SetGadgetItemText()
; Chart::SetLabelState()       - similar to SetGadgetItemState(), but 'label' instead of 'position'
; Chart::SetMargins()          - define top, left, right and bottom margin
; Chart::ToolTipText()         - defines the text for tooltips (#Percent$ / #Value$ / #Label$ / #Serie$)
; Chart::UpdatePopupText()     - updates the menu item text before the popup menu is displayed

; --- Data Series ---

; Chart::AddDataSeries()       - add a new data series
; Chart::AddSeriesItem()       - add a new item to the data series
; Chart::DisplayDataSeries()   - displays the data series
; Chart::EventDataSeries()     - returns the value of the item by index
; Chart::GetSeriesColor()      - returns the color of the data series
; Chart::GetSeriesItemState()  - returns the value of the item by index
; Chart::GetSeriesLabelState() - returns the value of the item by label
; Chart::RemoveSeriesItem()    - removes the item by index
; Chart::RemoveSeriesLabel()   - removes the item by label
; Chart::RemoveDataSeries()    - removes the data series
; Chart::SetSeriesItemState()  - sets the value of the item by index
; Chart::SetSeriesLabelState() 

; --- Scatter Plot ---

; Chart::AddScatterPlot()       - add a new scatter plot
; Chart::AddScatterItem()       - add a new item to the scatter plot
; Chart::DisplayScatterPlot()   - displays the scatter plot
; Chart::EventScatterPlot()     - returns the label of the scatter plot after the event
; Chart::EventDataX()           - returns dataX after the event 
; Chart::EventDataY()           - returns dataY after the event 
; Chart::GetScatterColor()      - returns the color of the scatter plot
; Chart::GetScatterItem()       - returns the value of the item by index [#DataX/#DataY]
; Chart::GetScatterLabelData()  - returns the value of the item by label [#DataX/#DataY]
; Chart::RemoveScatterPlot()    - removes the item by index
; Chart::RemoveScatterItem()    - removes the item by label
; Chart::RemoveScatterLabel()   - removes the data series
; Chart::SetScatterItem()       - sets the values of the item by index
; Chart::SetScatterLabelData()  - sets the values of the item by label
Download: ChartModule.pbi
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:12, insgesamt 12-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Bar Chart - Gadget (Säulendiagramm)

Beitrag von Thorsten1867 »

Update:
  • Hinzugefügt: Unterstützung negativer Werte
  • Hinzugefügt: Attribut '#AdjustMaximum' (#True/#False) um den Maximumwert anzupassen, wenn notwendig. (= Default)
  • Hinzugefügt: Attribut '#ScaleSpacing' (#Single/#Double) für die automatische Berechnung der Anzahl der Skalenstriche.
Bild
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:14, insgesamt 2-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Bar Chart - Gadget (Säulendiagramm)

Beitrag von Thorsten1867 »

Update:
  • Added: Pie Charts
Bild

( Herauszufinden, ob die Maus in einen Kreissektor geklickt hat, war eine echte mathematische Herausforderung. 8) )
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:15, insgesamt 1-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Nino
Beiträge: 1300
Registriert: 13.05.2010 09:26
Wohnort: Berlin

Re: [Module] Chart - Gadget (Kreis- & Säulendiagramm)

Beitrag von Nino »

Hallo,

ich habe das Modul noch nicht ausprobiert, aber die Diagramme hier im Thread sehen gut aus! :allright:

Wird bei den Säulendiagrammen auch die Darstellung mehrerer Datenreihen unterstützt (wie z.B. hier auf den Bildern zu sehen)?
Das wäre für einen Einsatz im professionellen (z.B. wissenschaftlichen) Bereich nötig.
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Chart - Gadget (Kreis- & Säulendiagramm)

Beitrag von Thorsten1867 »

Update:
  • Diagramm für Datenreihen hinzugefügt
  • Unterstützung für Popupmenüs (Chart & Legende) mit automatischer Aktualisierung der Menüitemtexte (z.B. #Label$ / #Series$)
  • vereinfachte Bereitstellung von Eventdaten
  • SetAttribute() teilweise durch SetFlags() ersetzt.
Bild
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Chart - Gadget (Kreis- & Säulendiagramm)

Beitrag von Thorsten1867 »

Update: Balkendiagramm (also: horizontale Balken)

Bild
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:17, insgesamt 1-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Chart - Gadget (vers. Diagramme)

Beitrag von Thorsten1867 »

Update: Kurvendiagramm

Bild
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:17, insgesamt 1-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Andesdaf
Moderator
Beiträge: 2660
Registriert: 15.06.2008 18:22
Wohnort: Dresden

Re: [Module] Chart - Gadget (vers. Diagramme)

Beitrag von Andesdaf »

Schöne Sache, danke :allright:
Win11 x64 | PB 6.00 (x64)
Benutzeravatar
RSBasic
Admin
Beiträge: 8022
Registriert: 05.10.2006 18:55
Wohnort: Gernsbach
Kontaktdaten:

Re: [Module] Chart - Gadget (vers. Diagramme)

Beitrag von RSBasic »

+1 :allright:
Aus privaten Gründen habe ich leider nicht mehr so viel Zeit wie früher. Bitte habt Verständnis dafür.
Bild
Bild
Benutzeravatar
Thorsten1867
Beiträge: 1359
Registriert: 04.02.2005 15:40
Computerausstattung: [Windows 10 x64] [PB V5.7x]
Wohnort: Kaufbeuren
Kontaktdaten:

Re: [Module] Chart - Gadget (vers. Diagramme)

Beitrag von Thorsten1867 »

Update: Kurvendiagramm in Kombination mit Datenreihen

Bild
Zuletzt geändert von Thorsten1867 am 20.12.2019 16:18, insgesamt 1-mal geändert.
Download of PureBasic - Module
Download of PureBasic - Programmes

[Windows 11 x64] [PB V6]

Bild
Antworten