eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'BarChartWidget':

Home

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

Class: BarChartWidget


Inheritance:

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

Package:
stx:libwidg3
Category:
Views-Misc
Version:
rev: 1.15 date: 2017/11/28 18:27:50
user: cg
file: BarChartWidget.st directory: libwidg3
module: stx stc-classLibrary: libwidg3
Author:
Timo Merkert (tm@idefix)

Description:


This is a demo widget programmed as a learning experience...

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.



[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


Related information:

    PieChartWidget
    ChartDescription

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)

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

drawing
o  drawBarBars
draw some filled rectangle as like bars in a barChart.

o  drawBarChart
get number of bars

o  drawBarScale
xAbstand is a instanzVariable

o  drawBarScale2
xAbstand is a instanzVariable

o  drawLogo
put demo values into model

o  redrawBarChart
Instanzvariablen initialisieren

o  writeLabel

event handling
o  redrawX: x y: y width: w height: h

o  sizeChanged: how

hooks
o  postBuildWith: aBuilder
automatically generated by UIPainter ...
usage example(s):
super postBuildWith:aBuilder

initialization
o  initialize
initialisierung und sein Kind

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 Gesamtsumme

o  standardColors

o  valuesDo: aBlock

views
o  getBarChartWidget


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


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Sun, 22 Jul 2018 12:30:45 GMT