[ANN] RTStackBarPlot

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] RTStackBarPlot

abergel
Hi!

Today Andrei and I pair-programmed on a stack bar plot builder. 

Here is an example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
b := RTStackBarPlot new.
b interaction popupText.
b colorPalette colors: { Color blue . Color lightBlue }.
b add: #(37 33 0 0 0) title: 'DN1'.
b add: #(24 26 17 3 0) title: 'DN2'.
b add: #(25 29 15 1 0) title: 'DN3'.
b add: #(30 33 6 1 0) title: 'DN4'.
b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
b barWidth: 260 height: 20.

b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString, '%' ] if: [:assoc | assoc key > 5 ] color: Color white.

b build.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Result is the following:

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




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RTStackBarPlot

Tudor Girba-2
He he. Nice :)

Doru

On Fri, Dec 12, 2014 at 9:18 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Today Andrei and I pair-programmed on a stack bar plot builder. 

Here is an example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
b := RTStackBarPlot new.
b interaction popupText.
b colorPalette colors: { Color blue . Color lightBlue }.
b add: #(37 33 0 0 0) title: 'DN1'.
b add: #(24 26 17 3 0) title: 'DN2'.
b add: #(25 29 15 1 0) title: 'DN3'.
b add: #(30 33 6 1 0) title: 'DN4'.
b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
b barWidth: 260 height: 20.

b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString, '%' ] if: [:assoc | assoc key > 5 ] color: Color white.

b build.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Result is the following:

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




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



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RTStackBarPlot

stepharo
+1

Stef
Le 12/12/14 21:16, Tudor Girba a écrit :
He he. Nice :)

Doru

On Fri, Dec 12, 2014 at 9:18 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Today Andrei and I pair-programmed on a stack bar plot builder. 

Here is an example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
b := RTStackBarPlot new.
b interaction popupText.
b colorPalette colors: { Color blue . Color lightBlue }.
b add: #(37 33 0 0 0) title: 'DN1'.
b add: #(24 26 17 3 0) title: 'DN2'.
b add: #(25 29 15 1 0) title: 'DN3'.
b add: #(30 33 6 1 0) title: 'DN4'.
b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
b barWidth: 260 height: 20.

b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString, '%' ] if: [:assoc | assoc key > 5 ] color: Color white.

b build.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Result is the following:

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




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



--

"Every thing has its own flow"


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


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RTStackBarPlot

Offray
In reply to this post by abergel
Hi,

My graphic went pretty differently. See attached screenshot.

I'm using Roassal2-PierreChanson.659.mcz, there is something else I need
to update to get this stack bar plot?

Cheers,

Offray

El 12/12/14 a las 14:18, Alexandre Bergel escribió:

> Hi!
>
> Today Andrei and I pair-programmed on a stack bar plot builder.
>
> Here is an example:
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> b := RTStackBarPlot new.
> b interaction popupText.
> b colorPalette colors: { Color blue . Color lightBlue }.
> b add: #(373300 0) title: 'DN1'.
> b add: #(2426173 0) title: 'DN2'.
> b add: #(2529151 0) title: 'DN3'.
> b add: #(303361 0) title: 'DN4'.
> b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
> b barWidth: 260 height: 20.
>
> b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString,
> '%' ] if: [:assoc | assoc key > 5 ] color: Color white.
>
> b build.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Result is the following:
>
> Cheers,
> Andrei & Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>

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

barplot.png (95K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] RTStackBarPlot

abergel
Hi Offray,

The script you’ve entered is not correct. Apparently some tabulation char have been wrongly replaced. Try this:

 | b |
 b := RTStackBarPlot new.
 b interaction popupText.
 b colorPalette colors: { Color blue . Color lightBlue }.
 b add: #(37 33 0 0 0) title: 'DN1'.
 b add: #(24 26 17 3 0) title: 'DN2'.
 b add: #(25 29 15 1 0) title: 'DN3'.
 b add: #(30 33 6 1 0) title: 'DN4'.
     
 b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
 b barWidth: 260 height: 20.

 b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString, '%' ] if: [:assoc | assoc key > 5 ] color: Color white.

 b build.
 ^ b view canvas


> On Dec 14, 2014, at 4:56 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>
> Hi,
>
> My graphic went pretty differently. See attached screenshot.
>
> I'm using Roassal2-PierreChanson.659.mcz, there is something else I need to update to get this stack bar plot?
>
> Cheers,
>
> Offray
>
> El 12/12/14 a las 14:18, Alexandre Bergel escribió:
>> Hi!
>>
>> Today Andrei and I pair-programmed on a stack bar plot builder.
>>
>> Here is an example:
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> b := RTStackBarPlot new.
>> b interaction popupText.
>> b colorPalette colors: { Color blue . Color lightBlue }.
>> b add: #(373300 0) title: 'DN1'.
>> b add: #(2426173 0) title: 'DN2'.
>> b add: #(2529151 0) title: 'DN3'.
>> b add: #(303361 0) title: 'DN4'.
>> b addLegend: #('strongly agree' 'agree' 'neutral' 'disagree' 'strongly disagree').
>> b barWidth: 260 height: 20.
>>
>> b addLabelToBars: [ :assoc | (assoc key  / b totalSum * 100) asInteger asString,
>> '%' ] if: [:assoc | assoc key > 5 ] color: Color white.
>>
>> b build.
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> Result is the following:
>>
>> Cheers,
>> Andrei & Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
> <barplot.png>_______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




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