GanttChartMorph usage and a small request

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

GanttChartMorph usage and a small request

cbc
Hi.  Here's how I'm using GanttChart - for process monitoring,  I have some process that run throughout the day, and I like to be able to see back a bit how often the fail (or don't run) over the month.  For this view, I group them up at the day period.

Here's the script (picture below):

green := Color green alpha: 0.4.
red := Color red alpha: 0.6.
gray := Color gray alpha: 0.4.
data := {
{ #good. 0. 18. #P1. green. }. { #good. 24. 31. #P1. green. }.
{ #good. 0. 23. #P2. green. }. {#good. 24. 31. #P2. green. }.
{ #good. 0. 8. #P3. green. }. { #failed. 8. 9. #P3. red. }. {#good. 9. 31. #P3. green. }.
{ #good. 0. 24. #P4. green. }. {#good. 25. 31. #P4. green. }.
}.

b := RTTimeline new.
s := RTTimelineSet new.
s objects: data.
s lineIdentifier: #fourth.
s start: #second.
s end: #third.
s shape fillColor: #fifth.
b add: s.
b axisX 
numberOfLabels: 5;
labelRotation: -45;
labelConversion: [ :v | Date year: 2015 day: v + 107 ]. 
d := RTVerticalTickLineDecorator new.
d shape line color: Color white.
b axisX numberOfDecoratorTicks: 31.
b addDecorator: d.
b open.

Inline image 1
Each veritcal bar is a day.  Did this with changing RTVerticalTickLineDecorator to check for a different step than the label step - basically, caused the decorator to use a sub-tick number (using b axisX numberOfDecoratorTicks: 31 - new method added).

So, the request - is there a correct way to do 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: GanttChartMorph usage and a small request

abergel
Hi Chris,

I do not understand what numberOfDecoratorTicks actually means.
How many ticks you wish to have ? And how many labels?

Cheers,
Alexandre


> On May 19, 2015, at 2:35 PM, Chris Cunningham <[hidden email]> wrote:
>
> Hi.  Here's how I'm using GanttChart - for process monitoring,  I have some process that run throughout the day, and I like to be able to see back a bit how often the fail (or don't run) over the month.  For this view, I group them up at the day period.
>
> Here's the script (picture below):
>
> green := Color green alpha: 0.4.
> red := Color red alpha: 0.6.
> gray := Color gray alpha: 0.4.
> data := {
> { #good. 0. 18. #P1. green. }. { #good. 24. 31. #P1. green. }.
> { #good. 0. 23. #P2. green. }. {#good. 24. 31. #P2. green. }.
> { #good. 0. 8. #P3. green. }. { #failed. 8. 9. #P3. red. }. {#good. 9. 31. #P3. green. }.
> { #good. 0. 24. #P4. green. }. {#good. 25. 31. #P4. green. }.
> }.
>
> b := RTTimeline new.
> s := RTTimelineSet new.
> s objects: data.
> s lineIdentifier: #fourth.
> s start: #second.
> s end: #third.
> s shape fillColor: #fifth.
> b add: s.
> b axisX
> numberOfLabels: 5;
> labelRotation: -45;
> labelConversion: [ :v | Date year: 2015 day: v + 107 ].
> d := RTVerticalTickLineDecorator new.
> d shape line color: Color white.
> b axisX numberOfDecoratorTicks: 31.
> b addDecorator: d.
> b open.
>
> <image.png>
> Each veritcal bar is a day.  Did this with changing RTVerticalTickLineDecorator to check for a different step than the label step - basically, caused the decorator to use a sub-tick number (using b axisX numberOfDecoratorTicks: 31 - new method added).
>
> So, the request - is there a correct way to do this?
>
> -cbc
> _______________________________________________
> 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
cbc
Reply | Threaded
Open this post in threaded view
|

Re: GanttChartMorph usage and a small request

cbc


On Tue, May 19, 2015 at 1:32 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Chris,

I do not understand what numberOfDecoratorTicks actually means.
How many ticks you wish to have ? And how many labels? 

What I would like is the graph to show as I sent it earlier. That is, each day is separated from the next day.  In this case, I need 30 dividers to show the 31 days.  And there are only 6 ticks shown (as I asked it to do).
I utilized the RTVerticalTickLineDecorator class to build these divisions (as I noticed happening in one of the examples in the code).  However, I don't want to label each day - there isn't enough space.
So, the number of labels wants to be significantly less than the number of divisions I want.

Maybe this could be acheived by, say, having a #labelEvery: method where I could, say, label every 7th tick.
I chose to instead let the decorator have its number of ticks be potentially divorced from the labeled number of ticks. Maybe not the ideal solution.

What I'd really, really like is to have the X axis be defined by a time period that I give it, and give it a period to apply ticks over (such as #day,or #hour), and another ability to divide gantt chart bars over (again, #day or #hour), and have the data given to the chart be durations (a start DateTime with duration from then on), and have the chart itself figure out how all of it fits together.  This would be my ideal!

Thanks,
cbc

Cheers,
Alexandre
<snip>


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

Re: GanttChartMorph usage and a small request

abergel
In reply to this post by cbc
Hi Chris,

I have updated Roassal to support the behavior you wish. As you can see, I did not modify the RTAxisConfiguration. Instead the decorator has been improved.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
green := Color green alpha: 0.4.
red := Color red alpha: 0.6.
gray := Color gray alpha: 0.4.
data := {
                                { #good. 0. 18. #P1. green. }. { #good. 24. 31. #P1. green. }.
                          { #good. 0. 23. #P2. green. }. {#good. 24. 31. #P2. green. }.
                          { #good. 0. 8. #P3. green. }. { #failed. 8. 9. #P3. red. }. {#good. 9. 31. #P3. green. }.
                          { #good. 0. 24. #P4. green. }. {#good. 25. 31. #P4. green. }.
                                }.

        b := RTTimeline new.
        s := RTTimelineSet new.
        s objects: data.
        s lineIdentifier: #fourth.
        s start: #second.
        s end: #third.
        s shape fillColor: #fifth.
        b add: s.
        b axisX
                numberOfLabels: 5;
                labelRotation: -45;
                labelConversion: [ :v | Date year: 2015 day: v + 107 ].
        d := RTVerticalTickLineDecorator new.
        d numberOfTicks: 31.
        d shape line color: Color white.
        b addDecorator: d.
        b open.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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



> On May 19, 2015, at 2:35 PM, Chris Cunningham <[hidden email]> wrote:
>
> Hi.  Here's how I'm using GanttChart - for process monitoring,  I have some process that run throughout the day, and I like to be able to see back a bit how often the fail (or don't run) over the month.  For this view, I group them up at the day period.
>
> Here's the script (picture below):
>
> green := Color green alpha: 0.4.
> red := Color red alpha: 0.6.
> gray := Color gray alpha: 0.4.
> data := {
> { #good. 0. 18. #P1. green. }. { #good. 24. 31. #P1. green. }.
> { #good. 0. 23. #P2. green. }. {#good. 24. 31. #P2. green. }.
> { #good. 0. 8. #P3. green. }. { #failed. 8. 9. #P3. red. }. {#good. 9. 31. #P3. green. }.
> { #good. 0. 24. #P4. green. }. {#good. 25. 31. #P4. green. }.
> }.
>
> b := RTTimeline new.
> s := RTTimelineSet new.
> s objects: data.
> s lineIdentifier: #fourth.
> s start: #second.
> s end: #third.
> s shape fillColor: #fifth.
> b add: s.
> b axisX
> numberOfLabels: 5;
> labelRotation: -45;
> labelConversion: [ :v | Date year: 2015 day: v + 107 ].
> d := RTVerticalTickLineDecorator new.
> d shape line color: Color white.
> b axisX numberOfDecoratorTicks: 31.
> b addDecorator: d.
> b open.
>
> <image.png>
> Each veritcal bar is a day.  Did this with changing RTVerticalTickLineDecorator to check for a different step than the label step - basically, caused the decorator to use a sub-tick number (using b axisX numberOfDecoratorTicks: 31 - new method added).
>
> So, the request - is there a correct way to do 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