Happy !

ObjectProfile / GraphET2

Project infos

License MIT
Tags pdf, charts, roassal, svg
Creation date 2014-03-20
Website www.objectprofile.com

Monticello registration

About GraphET2

Graph-ET2

GraphET2 is a library for creating awesome charts quick&easy for visualize it on your image or export them as PDF or SVG files.

This is the second version of GraphET which was wrote by Daniel Aviv. This version is built on top of Roassal2 and its maintained by Pablo Estefó.

Download

Gofer new smalltalkhubUser: 'ObjectProfile' 
project: 'GraphET2';
package: 'ConfigurationOfGraphET2';
load.
(Smalltalk at: #ConfigurationOfGraphET2) load

Examples

Bar

|builder|
builder := GET2VerticalBar data: ((1 to: 15) collect: [ :v | 10 atRandom - 5 ]).
builder color: [ :val |         |alpha MAX|
    MAX := 8.
    alpha := [ :v | (v abs / MAX) ].
    val positive ifTrue: [ Color blue alpha: (alpha value: val) ]
                  ifFalse: [ Color purple alpha: (alpha value: val) ]
     ].
builder open.

image

Scatterplot

| values builder |
values :=  #( #(1 3 9) #(3 2 7) #(5 14 5) #(6 10 7) #(7 9 9) #(8 8 10) ).

builder := GET2Scatterplot data: values.
builder 
    color: (Color purple alpha:0.4);
    x: #first;
    y: #second;
    r: [:v| v third * 4].

builder open.

image

Line

|builder normalizer data|
data := #(#(1 4) #(3 2) #(4 5) #(5 4) #(6 10) #(10 30) #(12 25)).

normalizer := RTNColorLinearNormalizer 
                inContext: data 
                withCommand: #second 
                lowColor: Color paleRed 
                highColor: Color blue.

builder := GET2Line data: data.
builder
    x: #first;
    y: #second;
    lineWidth: 2;
    dotColor: [ :v |  (normalizer rtValue: v) alpha: 0.5];
    dotSize: 15.

builder open.

image