|
Class: BarChart
Object
|
+--AbstractChart
|
+--BarChart
- Package:
- stx:libwidg3
- Category:
- Statistic-Charts
- Version:
- rev:
1.11
date: 2017/11/28 18:23:45
- user: cg
- file: BarChart.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
- Author:
- Timo Merkert (tm@idefix)
hallo erstmal...
a simple BarChart,
The model is a collection of chart description items,
each being a dictionary filled with entries for:
#value aNumber the numeric value
#color aColor the color
see example on how to fill such a chartDescription model.
This was one if the author's very first smalltalk programs ever.
So please excuse any odd code.
[instance variables:]
minWidth left Viewport limit
maxWidth right Viewport limit
maxHeight top Viewport limit
minHeight bottom Viewport limit
xAbstand difference between vertical lines
yMaxScale limit of horizontal value
anzahl number of values
summe summe of all values
maxWert biggest value
schrumpf factor of ...
aod Aray of Dictionaries
foregroundColor color for label
backgroundColor color for background lines
label1 name of bar chart
style fontstyle
newfont
oldfont
PieChartWidget
ChartDescription
instance creation
-
new
-
startup
-
open
-
accessing
-
anzahl
-
return the value of the instance variable 'anzahl' (automatically generated)
-
anzahl: something
-
set the value of the instance variable 'anzahl' (automatically generated)
-
aod
-
return the value of the instance variable 'aod' (automatically generated)
-
aod: something
-
set the value of the instance variable 'aod' (automatically generated)
-
barChartName
-
return the value of the instance variable 'barChartName' (automatically generated)
-
barChartName: something
-
set the value of the instance variable 'barChartName' (automatically generated)
-
label
-
-
label: aString
-
-
maxHeight
-
return the value of the instance variable 'maxHeight' (automatically generated)
-
maxHeight: something
-
set the value of the instance variable 'maxHeight' (automatically generated)
-
maxWert
-
return the value of the instance variable 'maxWert' (automatically generated)
-
maxWert: something
-
set the value of the instance variable 'maxWert' (automatically generated)
-
maxWidth
-
return the value of the instance variable 'maxWidth' (automatically generated)
-
maxWidth: something
-
set the value of the instance variable 'maxWidth' (automatically generated)
-
minHeight
-
return the value of the instance variable 'minHeight' (automatically generated)
-
minHeight: something
-
set the value of the instance variable 'minHeight' (automatically generated)
-
minWidth
-
return the value of the instance variable 'minWidth' (automatically generated)
-
minWidth: something
-
set the value of the instance variable 'minWidth' (automatically generated)
-
model: newModel
-
set the value of the instance variable 'model' (automatically generated)
-
newfont
-
return the value of the instance variable 'newfont' (automatically generated)
-
newfont: something
-
set the value of the instance variable 'newfont' (automatically generated)
-
oldfont
-
return the value of the instance variable 'oldfont' (automatically generated)
-
oldfont: something
-
set the value of the instance variable 'oldfont' (automatically generated)
-
schrumpf
-
return the value of the instance variable 'schrumpf' (automatically generated)
-
schrumpf: something
-
set the value of the instance variable 'schrumpf' (automatically generated)
-
style
-
return the value of the instance variable 'style' (automatically generated)
-
style: something
-
set the value of the instance variable 'style' (automatically generated)
-
summe
-
return the value of the instance variable 'summe' (automatically generated)
-
summe: something
-
set the value of the instance variable 'summe' (automatically generated)
-
xAbstand
-
return the value of the instance variable 'xAbstand' (automatically generated)
-
xAbstand: something
-
set the value of the instance variable 'xAbstand' (automatically generated)
-
yMaxScale
-
return the value of the instance variable 'yMaxScale' (automatically generated)
-
yMaxScale: something
-
set the value of the instance variable 'yMaxScale' (automatically generated)
accessing-color & font
-
backgroundColor
-
return the value of the instance variable 'backgroundColor' (automatically generated)
-
backgroundColor: something
-
set the value of the instance variable 'backgroundColor' (automatically generated)
-
foregroundColor
-
return the value of the instance variable 'foregroundColor' (automatically generated)
-
foregroundColor: something
-
set the value of the instance variable 'foregroundColor' (automatically generated)
drawing
-
drawBarBarsOn: aView
-
draw some filled rectangle as like bars in a barChart.
-
drawBarChartOn: aView
-
get number of bars
-
drawBarScale2On: aView
-
xAbstand is a instanzVariable
-
drawBarScaleOn: aView
-
xAbstand is a instanzVariable
-
drawLogoOn: aView
-
put demo values into model
-
redrawBarChartOn: aView
-
Instanzvariablen initialisieren
-
writeLabelOn: aView
-
initialization
-
initialize
-
private
-
getAnzahl
-
ermittelt die Anzahl der belegten Diagrammstücke
-
getMaxWert
-
initialisiert die Instanzvariable maxWert mit dem größten Wert
-
getSumme
-
initialisiert die Instanzvariable summe mit der Gesammtsumme
|p chart bars holder|
chart := OrderedCollection new.
bars := Dictionary new.
bars at:#value put:50.
bars at:#color put:(Color red).
chart add:bars.
bars := Dictionary new.
bars at:#value put:100.
bars at:#color put:(Color blue).
chart add:bars.
p := BarChartWidget new.
p model:(holder := ValueHolder new).
p extent:400@250.
p label:'demo BarChart'.
p open.
holder value:chart.
Delay waitForSeconds:2.
1 to: 5 do:[:i |
bars := Dictionary new.
bars at:#value put:30.
bars at:#color put:(i odd ifTrue:[Color green] ifFalse:[Color magenta]).
chart add:bars.
holder value:nil.
holder value:chart.
]
|
|p chart bars holder v|
chart := OrderedCollection new.
bars := Dictionary new.
bars at:#value put:50.
bars at:#color put:(Color red).
chart add:bars.
bars := Dictionary new.
bars at:#value put:100.
bars at:#color put:(Color blue).
chart add:bars.
p := BarChart new.
p model:(holder := chart asValue).
p label:'demo BarChart'.
v := View new.
v extent:400@250.
v open.
Delay waitForSeconds:1.
p redrawBarChartOn:v.
|
|