|
Class: ChartDescription
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ChartDescription
- Package:
- stx:libwidg3
- Category:
- Views-Misc
- Version:
- rev:
1.17
date: 2017/11/28 18:25:52
- user: cg
- file: ChartDescription.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
- Author:
- Timo Merkert (tm@idefix)
This is a demo widget programmed as a learning experience...
hallo erstmal...
ChartDescription for a diagram, whose values are a model as like an array of dictionaries
so have a look at 'class - documentation - examples'
This can be used beside a BarChartWidget or PieChartWidget as
a legend (extracting its values from the same model).
[instance variables:]
xPos x-Koordinate für Color-Punkt
anzahl number of pie-pieces
summe result of all values
aod Array of Dictionaries
aoHilf Array für Hilfsvariablen der Winkelberechnungen
foregroundColor Textfarbe
backgroundColor Hintergrundfarbe
label1 Name der Legende
BarChartWidget
PieChartWidget
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)
-
model: newModel
-
-
summe
-
return the value of the instance variable 'summe' (automatically generated)
-
summe: something
-
set the value of the instance variable 'summe' (automatically generated)
-
verticalY
-
return the value of the instance variable 'verticalY' (automatically generated)
-
verticalY: something
-
set the value of the instance variable 'verticalY' (automatically generated)
-
xPos
-
return the value of the instance variable 'xPos' (automatically generated)
-
xPos: something
-
set the value of the instance variable 'xPos' (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
-
drawChartDesc
-
draw Demo
-
drawDemo
-
put demo values into model
-
drawDemo2
-
Zeilen Anordung
-
drawDescription
-
y-koordinate
-
redrawChartDesc
-
event handling
-
redrawX: x y: y width: w height: h
-
-
sizeChanged: how
-
Instanzvariablen initialisieren
hooks
-
postBuildWith: aBuilder
-
initialization
-
initialize
-
initialisierung und sein Kind
private
-
fillAod
-
"fills the Dictionaries in Array with Values"
-
getAnzahl
-
ermittelt die Anzahl der belegten Diagrammstücke
-
getMaxStringLen
-
ermittelt die position in aod, die den längsten String enthält
-
getNewFontSize
-
maximale Stringlänge
-
getNewFontSize2
-
neue Schriftgröße vorbereiten
-
getSumme
-
initialisiert die Instanzvariable summe mit der Gesammtsumme
-
getVerticalStep
-
y-koordinate
views
-
getChartDescription
-
|p chart piece holder|
chart := OrderedCollection new.
piece := Dictionary new.
piece at:#name put:'Güllemütz'.
piece at:#color put:Color red.
chart add:piece.
piece := Dictionary new.
piece at:#name put:'Hallabadkapp'.
piece at:#color put:Color blue.
chart add:piece.
p := ChartDescription new.
p model:(holder := ValueHolder new).
p open.
'here is the model'.
holder value:chart.
Delay waitForSeconds:2.
1 to: 20 do:[:i |
piece := Dictionary new.
i odd ifTrue:[
piece at:#name put:'Hallo erstmal...'.
piece at:#color put:Color green.
]
ifFalse:[
piece at:#name put:'...und Tschüss'.
piece at:#color put:Color magenta.
].
chart add:piece.
holder value:nil.
holder value:chart.
].
|
|