|
Class: BarChartWidget
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--BarChartWidget
- Package:
- stx:libwidg3
- Category:
- Views-Graphs
- Version:
- rev:
1.20
date: 2023/11/29 15:21:33
- user: cg
- file: BarChartWidget.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
This is a demo widget programmed as a learning experience...
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.
[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
copyrightCOPYRIGHT (c) 1998 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
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
-
(comment from inherited method)
return the view's label - this is nil here
-
label: aString
-
(comment from inherited method)
set the view's label.
Ignored here.
-
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)
change & update
-
update: something with: aParameter from: changedObject
-
drawing
-
drawBarBars
-
draw some filled rectangle as like bars in a barChart.
-
drawBarChart
-
get number of bars
-
drawBarScale
-
xAbstand is a instanzVariable
-
drawBarScale2
-
xAbstand is a instanzVariable
-
drawLogo
-
put demo values into model
-
redrawBarChart
-
Instanzvariablen initialisieren
-
writeLabel
-
event handling
-
redrawX: x y: y width: w height: h
-
(comment from inherited method)
redraw part of myself immediately, given logical coordinates
(if transformation is nonNil)
The default here is to redraw everything
- subclasses usually redefine this, adding more intelligence
-
sizeChanged: how from: oldExtentOrNil
-
my view has changed the size (not the contents)
hooks
-
postBuildWith: aBuilder
-
automatically generated by UIPainter ...
Usage example(s):
super postBuildWith:aBuilder
|
initialization
-
initialize
-
initialisierung und sein Kind
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 Gesamtsumme
-
standardColors
-
-
valuesDo: aBlock
-
views
-
getBarChartWidget
-
|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.
]
|
|