|
Class: ChartKey
Object
|
+--AbstractChart
|
+--ChartKey
- Package:
- stx:libwidg3
- Category:
- Statistic-Charts
- Version:
- rev:
1.9
date: 2017/11/28 18:23:46
- user: cg
- file: ChartKey.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
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).
This was one if the author's very first smalltalk programs ever.
So please excuse any odd code.
[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
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.
instance creation
-
new
-
(comment from inherited method)
return an instance of myself without indexed variables
startup
-
open
-
accessing
-
anzahl
-
-
aod
-
return the value of the instance variable 'aod' (automatically generated)
-
aod: something
-
set the value of the instance variable 'aod' (automatically generated)
-
getColorAt: aNumber
-
-
getNameAt: num
-
-
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)
-
xPosOn: aView
-
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)
class initialization
-
initialize
-
drawing
-
drawChartDescOn: aView inArea: aArea
-
fontOK == true ifFalse:[
-
drawDescriptionOn: aView inArea: anArea
-
draw colorpoint
-
redrawChartDescOn: aView inArea: aRect
-
private
-
getMaxFontSizeOn: aView inArea: anArea
-
needs to be refactored. hard coded attributes will confuse the reader.
-
getMaxStringLenOn: aView
-
|p chart piece holder|
chart := OrderedCollection new.
piece := Dictionary new.
piece at:#name put:'Güllemütz'.
piece at:#color put:(Color red on:Display).
chart add:piece.
piece := Dictionary new.
piece at:#name put:'Hallabadkapp'.
piece at:#color put:(Color blue on:Display).
chart add:piece.
p := ChartDescription new.
p model:(holder := ValueHolder new).
p open.
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 on:Display).
]
ifFalse:[
piece at:#name put:'...und Tschüss'.
piece at:#color put:Color magenta.
].
chart add:piece.
holder value:nil.
holder value:chart.
].
|
|p v chart piece holder|
chart := OrderedCollection new.
piece := Dictionary new.
piece at:#name put:'Güllemütz'.
piece at:#color put:(Color red on:Display).
chart add:piece.
piece := Dictionary new.
piece at:#name put:'Hallabadkapp'.
piece at:#color put:(Color blue on:Display).
chart add:piece.
p := ChartKey new.
p model:chart asValue.
v := View new.
v extent:1000@1000.
v open.
Delay waitForSeconds:1.
p redrawChartDescOn:v inArea:(400@400 extent:50@50).
|
|