eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'BarChart':

Home

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

Class: BarChart


Inheritance:

   Object
   |
   +--AbstractChart
      |
      +--BarChart

Package:
stx:libwidg3
Category:
Statistic-Charts
Version:
rev: 1.13 date: 2023/11/29 15:20:57
user: cg
file: BarChart.st directory: libwidg3
module: stx stc-classLibrary: libwidg3

Description:


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.
 This was one if the author's very first smalltalk programs ever.
 So please excuse any odd code.



 [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

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
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  barChartName
return the value of the instance variable 'barChartName' (automatically generated)

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

o  label

o  label: aString

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

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

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

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

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

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

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

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

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

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

o  model: newModel
set the value of the instance variable 'model' (automatically generated)

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

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

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

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

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

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

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

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

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  xAbstand
return the value of the instance variable 'xAbstand' (automatically generated)

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

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

o  yMaxScale: something
set the value of the instance variable 'yMaxScale' (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)

drawing
o  drawBarBarsOn: aView
draw some filled rectangle as like bars in a barChart.

o  drawBarChartOn: aView
get number of bars

o  drawBarScale2On: aView
xAbstand is a instanzVariable

o  drawBarScaleOn: aView
xAbstand is a instanzVariable

o  drawLogoOn: aView
put demo values into model

o  redrawBarChartOn: aView
Instanzvariablen initialisieren

o  writeLabelOn: aView

initialization
o  initialize

private
o  getAnzahl
ermittelt die Anzahl der belegten Diagrammstücke

o  getMaxWert
initialisiert die Instanzvariable maxWert mit dem größten Wert

o  getSumme
initialisiert die Instanzvariable summe mit der Gesammtsumme


Examples:


        |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.
        ]
        |p chart bars holder v|

        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 := BarChart new.
        p model:(holder := chart asValue).
        p label:'demo BarChart'.

        v := View new.
        v extent:400@250.
        v open.
        Delay waitForSeconds:1.
        p redrawBarChartOn:v.



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