eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ChartKey':

Home

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

Class: ChartKey


Inheritance:

   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

Description:


  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

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.

Class protocol:

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables

startup
o  open


Instance protocol:

accessing
o  anzahl

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  getColorAt: aNumber

o  getNameAt: num

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)

o  xPosOn: aView

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)

class initialization
o  initialize

drawing
o  drawChartDescOn: aView inArea: aArea
fontOK == true ifFalse:[

o  drawDescriptionOn: aView inArea: anArea
draw colorpoint

o  redrawChartDescOn: aView inArea: aRect

private
o  getMaxFontSizeOn: aView inArea: anArea
needs to be refactored. hard coded attributes will confuse the reader.

o  getMaxStringLenOn: aView


Examples:


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


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:23:14 GMT