eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ChartDescription':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: ChartDescription


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ChartDescription

Package:
stx:libwidg3
Category:
Views-Graphs
Version:
rev: 1.20 date: 2023/07/06 14:35:48
user: cg
file: ChartDescription.st directory: libwidg3
module: stx stc-classLibrary: libwidg3

Description:


 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

copyright

COPYRIGHT (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 protocol:

accessing
o  anzahl
return the value of the instance variable 'anzahl' (automatically generated)

o  anzahl: something
set the value of the instance variable 'anzahl' (automatically generated)

o  aod
return the value of the instance variable 'aod' (automatically generated)

o  aod: something
set the value of the instance variable 'aod' (automatically generated)

o  model: newModel
(comment from inherited method)
Set the model.
Here, if I am my own menuPerformer/menuHolder,
set the menuHolder and menuPerformer to the model.
This is a compatibility kludge,
since typically, ST-80 code expects the model to provide a menu
and perform it. If the model does not support a menu message,
it will be forwarded to the view.
Those apps which want the view to provide the (default) menu have to reset
this by sending #menuHolder: message (again)

o  summe
return the value of the instance variable 'summe' (automatically generated)

o  summe: something
set the value of the instance variable 'summe' (automatically generated)

o  verticalY
return the value of the instance variable 'verticalY' (automatically generated)

o  verticalY: something
set the value of the instance variable 'verticalY' (automatically generated)

o  xPos
return the value of the instance variable 'xPos' (automatically generated)

o  xPos: something
set the value of the instance variable 'xPos' (automatically generated)

accessing-color & font
o  backgroundColor
return the value of the instance variable 'backgroundColor' (automatically generated)

o  backgroundColor: something
set the value of the instance variable 'backgroundColor' (automatically generated)

o  foregroundColor
return the value of the instance variable 'foregroundColor' (automatically generated)

o  foregroundColor: something
set the value of the instance variable 'foregroundColor' (automatically generated)

change & update
o  update: something with: aParameter from: changedObject

drawing
o  drawChartDesc
draw Demo

o  drawDemo
put demo values into model

o  drawDemo2
Zeilen Anordung

o  drawDescription
y-koordinate

o  redrawChartDesc

event handling
o  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

o  sizeChanged: how from: oldExtentOrNil
my view has changed the size (not the contents)

hooks
o  postBuildWith: aBuilder

initialization
o  initialize
initialisierung und sein Kind

private
o  fillAod
"fills the Dictionaries in Array with Values"

o  getAnzahl
ermittelt die Anzahl der belegten Diagrammstücke

o  getMaxStringLen
ermittelt die position in aod, die den längsten String enthält

o  getNewFontSize
maximale Stringlänge

o  getNewFontSize2
neue Schriftgröße vorbereiten

o  getSumme
initialisiert die Instanzvariable summe mit der Gesammtsumme

o  getVerticalStep
y-koordinate

views
o  getChartDescription


Examples:


        |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.
        ].


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:54:47 GMT