Does Charter handle normal bar graphs currently?

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

Does Charter handle normal bar graphs currently?

cbc
I am currently using EyeSee for doing some charting/graphing, and am running into some of its limitations.  I'd like to use the newest/bestest, but am stumped how to use it right now.

Attached is roughly the graph I want:Inline image 1
except I'd like the bars to be located correctly for the time (as well as the labels). Or, even better, be able to state that I want the days labelled, and either hour tick marks, or optional tick marks.  And, of course, be able to specifically call out the color of the bars.

Data to build this chart:
x := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.

-cbc

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

Re: Does Charter handle normal bar graphs currently?

abergel
Hi Chris!

A first and quick try of your data gave me:

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b stackX.
b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | entry at: 'TIME' ].

b axisY.
b newAxisConfiguration plain.
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=


Is this what you expect?

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



On Nov 4, 2014, at 5:41 PM, Chris Cunningham <[hidden email]> wrote:

I am currently using EyeSee for doing some charting/graphing, and am running into some of its limitations.  I'd like to use the newest/bestest, but am stumped how to use it right now.

Attached is roughly the graph I want:<image.png>
except I'd like the bars to be located correctly for the time (as well as the labels). Or, even better, be able to state that I want the days labelled, and either hour tick marks, or optional tick marks.  And, of course, be able to specifically call out the color of the bars.

Data to build this chart:
x := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.

-cbc
_______________________________________________
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
cbc
Reply | Threaded
Open this post in threaded view
|

Re: Does Charter handle normal bar graphs currently?

cbc
Hi Alexandre,
this is close.  It at least mirrors what I could get elsewhere (with work).

What I'd really like is:
1. To just have the DATE shown on the X axis (easy to do)
2. To have the bars be places on the X axis relative to where they would be in a timeline.  Harder to do - maybe need to make the values based on minutes since first value?  or beginning of first day?  I think I might see this - but previous examples seem to use scatter type plots - and not histograms.  (Hmm, figured it out!)
3. To have the bars be skinny enough (when needed) to show the close times.

If you look at the data, the gray and green bars are all 1 day apart from each other.  The RED one is 1/2 hour after the second gray one - it would be nice to show them that close together.

This code gets close - just need to shape the bars reasonably (the second gray bar is almost completely hidden):

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | ((v at: 'TIME') asDuration asMinutes) floor + ((v at: 'TIME') julianDayNumber * 1440) - firstDay ].

b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | '' ].

b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=
Inline image 1

On Tue, Nov 4, 2014 at 2:17 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Chris!

A first and quick try of your data gave me:

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b stackX.
b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | entry at: 'TIME' ].

b axisY.
b newAxisConfiguration plain.
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=


Is this what you expect?

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



On Nov 4, 2014, at 5:41 PM, Chris Cunningham <[hidden email]> wrote:

I am currently using EyeSee for doing some charting/graphing, and am running into some of its limitations.  I'd like to use the newest/bestest, but am stumped how to use it right now.

Attached is roughly the graph I want:<image.png>
except I'd like the bars to be located correctly for the time (as well as the labels). Or, even better, be able to state that I want the days labelled, and either hour tick marks, or optional tick marks.  And, of course, be able to specifically call out the color of the bars.

Data to build this chart:
x := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.

-cbc
_______________________________________________
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



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

Re: Does Charter handle normal bar graphs currently?

cbc
What would be really nice is to just say "It's a date X axis, do something smart."

And, THANKS for helping with this!

-cbc

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

Re: Does Charter handle normal bar graphs currently?

abergel
In reply to this post by cbc
Humm…

From your description, I have doubt that you really need an histogram.

Here your script with a different width (you need to update Roassal for this):

=-=-=-==-=-=-==-=-=-==-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
oldestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asUnixTime ]) min.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | (v at: 'TIME') asUnixTime - oldestEntryDate ].

b shape rectangle 
width: 5;
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | '' ] width: 5.

b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
=-=-=-==-=-=-==-=-=-==-=-=-=

I use asUnixTime instead of the floor, minutes, and julianDayNumber conversions. 

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



On Nov 4, 2014, at 8:32 PM, Chris Cunningham <[hidden email]> wrote:

Hi Alexandre,
this is close.  It at least mirrors what I could get elsewhere (with work).

What I'd really like is:
1. To just have the DATE shown on the X axis (easy to do)
2. To have the bars be places on the X axis relative to where they would be in a timeline.  Harder to do - maybe need to make the values based on minutes since first value?  or beginning of first day?  I think I might see this - but previous examples seem to use scatter type plots - and not histograms.  (Hmm, figured it out!)
3. To have the bars be skinny enough (when needed) to show the close times.

If you look at the data, the gray and green bars are all 1 day apart from each other.  The RED one is 1/2 hour after the second gray one - it would be nice to show them that close together.

This code gets close - just need to shape the bars reasonably (the second gray bar is almost completely hidden):

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | ((v at: 'TIME') asDuration asMinutes) floor + ((v at: 'TIME') julianDayNumber * 1440) - firstDay ].

b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | '' ].

b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=
<image.png>

On Tue, Nov 4, 2014 at 2:17 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Chris!

A first and quick try of your data gave me:

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b stackX.
b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | entry at: 'TIME' ].

b axisY.
b newAxisConfiguration plain.
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=

<Screen Shot 2014-11-04 at 7.16.37 PM.png>

Is this what you expect?

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



On Nov 4, 2014, at 5:41 PM, Chris Cunningham <[hidden email]> wrote:

I am currently using EyeSee for doing some charting/graphing, and am running into some of its limitations.  I'd like to use the newest/bestest, but am stumped how to use it right now.

Attached is roughly the graph I want:<image.png>
except I'd like the bars to be located correctly for the time (as well as the labels). Or, even better, be able to state that I want the days labelled, and either hour tick marks, or optional tick marks.  And, of course, be able to specifically call out the color of the bars.

Data to build this chart:
x := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.

-cbc
_______________________________________________
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


_______________________________________________
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: Does Charter handle normal bar graphs currently?

abergel
In reply to this post by cbc
Yes, I am currently doing a major rework of Charter (you have have an idea of what I am doing with RTGrapherBuilder). 

Indeed, being able to efficiently manipulate date is crucial!

Let me know how it goes!

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



On Nov 4, 2014, at 8:34 PM, Chris Cunningham <[hidden email]> wrote:

What would be really nice is to just say "It's a date X axis, do something smart."

And, THANKS for helping with this!

-cbc
_______________________________________________
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: Does Charter handle normal bar graphs currently?

abergel
In reply to this post by abergel
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
oldestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asUnixTime ]) min.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b interaction 
popupText: [:entry | entry at: 'TIME'];
highlightColored: Color red.
b shape circle size: 8; color: [ :entry | (entry at: 'COLOR') alpha: 0.3 ].
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | (v at: 'TIME') asUnixTime - oldestEntryDate ].

b connectDotColor: (Color gray alpha: 0.4). 


b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Something like this is not enough?

Cheers,
Alexandre

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



On Nov 5, 2014, at 10:19 AM, Alexandre Bergel <[hidden email]> wrote:

Humm…

From your description, I have doubt that you really need an histogram.

Here your script with a different width (you need to update Roassal for this):

=-=-=-==-=-=-==-=-=-==-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
oldestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asUnixTime ]) min.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | (v at: 'TIME') asUnixTime - oldestEntryDate ].

b shape rectangle 
width: 5;
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | '' ] width: 5.

b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
=-=-=-==-=-=-==-=-=-==-=-=-=

I use asUnixTime instead of the floor, minutes, and julianDayNumber conversions. 

<Screen Shot 2014-11-05 at 10.17.04 AM.png>
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Nov 4, 2014, at 8:32 PM, Chris Cunningham <[hidden email]> wrote:

Hi Alexandre,
this is close.  It at least mirrors what I could get elsewhere (with work).

What I'd really like is:
1. To just have the DATE shown on the X axis (easy to do)
2. To have the bars be places on the X axis relative to where they would be in a timeline.  Harder to do - maybe need to make the values based on minutes since first value?  or beginning of first day?  I think I might see this - but previous examples seem to use scatter type plots - and not histograms.  (Hmm, figured it out!)
3. To have the bars be skinny enough (when needed) to show the close times.

If you look at the data, the gray and green bars are all 1 day apart from each other.  The RED one is 1/2 hour after the second gray one - it would be nice to show them that close together.

This code gets close - just need to shape the bars reasonably (the second gray bar is almost completely hidden):

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
firstDay := (data collect: [ :d| d at: 'TIME' ]) min.
base := firstDay julianDayNumber.
firstDay := (firstDay asDuration asMinutes) floor + (firstDay julianDayNumber * 1440).
b allX: [ :v | ((v at: 'TIME') asDuration asMinutes) floor + ((v at: 'TIME') julianDayNumber * 1440) - firstDay ].

b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | '' ].

b axisY.
"b newAxisConfiguration plain."
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: 4;
numberOfLabels: 4;
labelConvertion: [ :v | Transcript show: v asString; cr. Date julianDayNumber: (v / 1440) rounded + base ].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=
<image.png>

On Tue, Nov 4, 2014 at 2:17 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Chris!

A first and quick try of your data gave me:

-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
b := RTCharterBuilder new.
b extent: 300 @ 200.
b shape rectangle size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b stackX.
b shape rectangle 
color: [ :entry | entry at: 'COLOR' ].

b interaction 
highlightColored: Color red.
b histogramWithBarTitle: [ :entry | entry at: 'TIME' ].

b axisY.
b newAxisConfiguration plain.
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=

<Screen Shot 2014-11-04 at 7.16.37 PM.png>

Is this what you expect?

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



On Nov 4, 2014, at 5:41 PM, Chris Cunningham <[hidden email]> wrote:

I am currently using EyeSee for doing some charting/graphing, and am running into some of its limitations.  I'd like to use the newest/bestest, but am stumped how to use it right now.

Attached is roughly the graph I want:<image.png>
except I'd like the bars to be located correctly for the time (as well as the labels). Or, even better, be able to state that I want the days labelled, and either hour tick marks, or optional tick marks.  And, of course, be able to specifically call out the color of the bars.

Data to build this chart:
x := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.

-cbc
_______________________________________________
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


_______________________________________________
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


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

Re: Does Charter handle normal bar graphs currently?

cbc

On Wed, Nov 5, 2014 at 9:28 AM, Alexandre Bergel <[hidden email]> wrote:
[snip] 

Something like this is not enough?

Cheers,
Alexandre

[snip]

Well, I usually think of the lined graph as impying a continuity between the points; I want to state that it happened at a specific time, with nothing in between.  I also kinda like the bars in that is draws attention to them; the dots are to easy to overlook (especially the color, to my eyes).

So, I've taken some of these ideas and gotten the timing down better, and applied alpha so that I can see overlapping bars. This might be good enough for now, at least for me.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
oldestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asDate asDateAndTime asUnixTime ]) min.
newestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asUnixTime ]) max.
newestEntryDate = (DateAndTime fromUnixTime: newestEntryDate) asTime seconds = 0 ifFalse: [ 
newestEntryDate := ((DateAndTime fromUnixTime: newestEntryDate) asDate + 1 day) asDateAndTime asUnixTime.
data := data copyWith: (Dictionary new at: 'COLOR' put: Color white; at: 'TIME' put: (DateAndTime fromUnixTime: newestEntryDate); at: 'SECONDS' put: 0; yourself).
].

ticks := (newestEntryDate - oldestEntryDate) asDuration asDays asInteger * 4.

b := RTCharterBuilder new.
b extent: 300 @ 200.
b interaction 
popupText: [:entry | (entry at: 'TIME') asString, ' took ', (entry at: 'SECONDS') asString, ' seconds'];
highlightColored: Color blue.

b shape rectangle color: [ :entry | (entry at: 'COLOR' ) alpha: 0.6]; size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b allX: [ :v | (v at: 'TIME') asUnixTime - oldestEntryDate ].
b histogramWithBarTitle: [ :entry | '' ].

b axisY.
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: ticks;
numberOfLabels: ticks;
labelConvertion: [ :v | |lbl|
lbl := DateAndTime fromUnixTime: v + oldestEntryDate.
lbl asTime asSeconds = 0 ifTrue: [ lbl asDate ] ifFalse: [ '' ]
].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Inline image 1

And, incidentally, I'm really enjoying the playground.  Great fun!

-cbc

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

Re: Does Charter handle normal bar graphs currently?

abergel
Cool :-)

Let us know about your progress. Send us screenshots! We love them!

Alexandre

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



On Nov 5, 2014, at 7:30 PM, Chris Cunningham <[hidden email]> wrote:


On Wed, Nov 5, 2014 at 9:28 AM, Alexandre Bergel <[hidden email]> wrote:
[snip] 

Something like this is not enough?

Cheers,
Alexandre

[snip]

Well, I usually think of the lined graph as impying a continuity between the points; I want to state that it happened at a specific time, with nothing in between.  I also kinda like the bars in that is draws attention to them; the dots are to easy to overlook (especially the color, to my eyes).

So, I've taken some of these ideas and gotten the timing down better, and applied alpha so that I can see overlapping bars. This might be good enough for now, at least for me.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
data := {
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-30 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:11:28.0');
at: 'SECONDS' put: 5;
yourself.
Dictionary new
at: 'COLOR' put: Color red;
at: 'TIME' put: (DateAndTime fromString: '2014-10-31 12:41:28.0');
at: 'SECONDS' put: 15;
yourself.
Dictionary new
at: 'COLOR' put: Color green;
at: 'TIME' put: (DateAndTime fromString: '2014-11-01 12:11:28.0');
at: 'SECONDS' put: 7;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-02 12:11:28.0');
at: 'SECONDS' put: 1;
yourself.
Dictionary new
at: 'COLOR' put: Color gray;
at: 'TIME' put: (DateAndTime fromString: '2014-11-03 12:11:28.0');
at: 'SECONDS' put: 4;
yourself.
}.
oldestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asDate asDateAndTime asUnixTime ]) min.
newestEntryDate := (data collect: [ :entry | (entry at: 'TIME') asUnixTime ]) max.
newestEntryDate = (DateAndTime fromUnixTime: newestEntryDate) asTime seconds = 0 ifFalse: [ 
newestEntryDate := ((DateAndTime fromUnixTime: newestEntryDate) asDate + 1 day) asDateAndTime asUnixTime.
data := data copyWith: (Dictionary new at: 'COLOR' put: Color white; at: 'TIME' put: (DateAndTime fromUnixTime: newestEntryDate); at: 'SECONDS' put: 0; yourself).
].

ticks := (newestEntryDate - oldestEntryDate) asDuration asDays asInteger * 4.

b := RTCharterBuilder new.
b extent: 300 @ 200.
b interaction 
popupText: [:entry | (entry at: 'TIME') asString, ' took ', (entry at: 'SECONDS') asString, ' seconds'];
highlightColored: Color blue.

b shape rectangle color: [ :entry | (entry at: 'COLOR' ) alpha: 0.6]; size: 0.
b points: data.
b y: [ :entry | entry at: 'SECONDS' ].
b allX: [ :v | (v at: 'TIME') asUnixTime - oldestEntryDate ].
b histogramWithBarTitle: [ :entry | '' ].

b axisY.
b axisConfiguration 
title: '';
labelRotation: -30;
numberOfTicks: ticks;
numberOfLabels: ticks;
labelConvertion: [ :v | |lbl|
lbl := DateAndTime fromUnixTime: v + oldestEntryDate.
lbl asTime asSeconds = 0 ifTrue: [ lbl asDate ] ifFalse: [ '' ]
].
b axisX.
b build.
b view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

<image.png>

And, incidentally, I'm really enjoying the playground.  Great fun!

-cbc
_______________________________________________
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