Quantcast

Improved Grapher way of stacking data

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Improved Grapher way of stacking data

abergel
Hi!

Just to share an improvement of Grapher, which is part of Roassal.

The code:
| b d classes |
classes := (Collection withAllSubclasses reverseSortedAs: #numberOfMethods) first: 10.
b := RTGrapher new.

d := RTVerticalMultipleData new.
d points: classes.
d addMetric: #numberOfLinesOfCode.
d addMetric: #numberOfMethods.

d barChartWithBarTitle: #name rotation: -30.
b add: d.

b

Produces:

And this code:
| b d classes |
classes := (Collection withAllSubclasses reverseSortedAs: #numberOfMethods) first: 10.
b := RTGrapher new.

d := RTHorizontalMultipleData new.
d points: classes.
d addMetric: #numberOfLinesOfCode.
d addMetric: #numberOfMethods.

d barChartWithBarTitle: #name rotation: -30.
b add: d.

b

Produces:

Naturally, you can add several metrics:

Consider:
| b d classes |
b := RTGrapher new.

d := RTHorizontalMultipleData new.

d points: #( #('hello' 1 2 1) #('world' 2 4 2) #('bonjour' 3 5 4) #('Gutten Morgen' -1 4 -5)).
d addMetric: #second.
d addMetric: #third.
d addMetric: #fourth.

d barChartWithBarTitle: #first rotation: -30.
b add: d.

b

And:
| b d classes |
b := RTGrapher new.

d := RTVerticalMultipleData new.

d points: #( #('hello' 1 2 1) #('world' 2 4 2) #('bonjour' 3 5 4) ).
d addMetric: #second.
d addMetric: #third.
d addMetric: #fourth.

d barChartWithBarTitle: #first rotation: -30.
b add: d.

b

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Loading...