-
Notifications
You must be signed in to change notification settings - Fork 86
glgui barchart
Matthias Görges edited this page Apr 8, 2015
·
2 revisions
glgui-barchart adds a barchart to the screen. It supports both simple horizontal barcharts, as well as stacked barcharts. Coloring of individual bars is supported.
Parameter | Description |
---|---|
g | The Graphical User Interface (GUI) this widget belongs to |
x | Lower left corner along the x-axis in pixels |
y | Lower left corner along the y-axis in pixels |
w | Width of the widget in pixels |
h | Height of the widget in pixels |
v | List of values to be plotted |
c | Color the bars are filled with (Single value or list) |
Example 1: Draw a simple bar charts of values 1-4, colored in Blue.
(set! gui:main (make-glgui))
(glgui-barchart gui 0 0 150 150 '(1 2 3 4) Blue)
Example 2: Draw a simple bar charts of values 1-4, whereby each bar has a different color
(set! gui:main (make-glgui))
(glgui-barchart gui 0 170 150 150 '(1 2 3 4) (list Blue Red Green Yellow))
Example 3: Draw a stacked bar chart of values [1,3,5,7,9] at the bottom layer, with [2,4,6,8,0] on the top layer. The bottom layer is filled in green, the top layer in red.
(set! gui:main (make-glgui))
(glgui-barchart gui 170 170 150 150 '((1 2) (3 4) (5 6) (7 8) (9 0)) (list Green Red))
Besides the parameters set in the above procedure, the widget has the following attributes that can be set using glgui-widget-set! and retrieved using glgui-widget-get:
Attribute | Default Value | Description |
---|---|---|
spacer | (if (fx> (length v) 5) 2 5) | Space between bars in px |
vmax | (list-max v) | Reference height for bars |
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip