Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Events on timeline overlap

    Hi,

    We are upgrading from version 5 to version 12 of smartgwt. We use the timeline to show events (activities), which connect exactly in time with a resolution of 1 second. In version 5, the events on the timeline stack neatly horizontally, in v12 with the same code, the events snap differently. This results in overlapping activities, with each only taking half of the bar. Please see the attached picture + code. The events do not overlap but due to snapping they are rendered as if they do. Can someone give a hint how to get them stacked horizontally as in v5?

    Thanks,
    Itb
    Test.java
    Click image for larger version

Name:	Timeline.png
Views:	346
Size:	23.5 KB
ID:	259208

    #2
    If you can you show your timeline config, dataSource and a sample of data, we'll take a look.

    Comment


      #3
      I included the file test.java in the original post, did you miss that, or do you need more than that?

      Comment


        #4
        Ah, yes, we see it now - we'll take a look and get back to you shortly

        Comment


          #5
          We've made a change to better deal with this - now, when the start of one event is the same datetime as the end of another, you'll see the behavior you expect. If the datetiems are different, even by a second, they will overlap, because that's how overlapping works. You should find that as of builds dated September 1.

          On your code-comment about eventSnapGap:

          1) call setEventSnapGap() in createTimeline(), before the call to setTimelineRange(), which calls setResolution() and creates the internals of the timeline
          2) since you're calling setResolution() yourself in downstream code, instead of setTimelineRange(), call setStartDate() and setEndDate(), and rely on your subsequent call to setResolution() for creation

          [Edit - note that we've also made a change to have eventSnapGap be writable after creation - so you can call setEventSnapGap() at any time, as long as you rebuild the timeline afterward, with a call to setResolution() or similar.]
          Last edited by Isomorphic; 2 Sep 2019, 00:58.

          Comment


            #6
            Hi, this build is not available yet, right? last build is August 28th?

            Comment


              #7
              We had a problem with our internal build mechanism which is now fixed - you should see builds arrive tomorrow.

              Comment


                #8
                I do not see a new build yet, correct?

                Comment


                  #9
                  The builds are working again now.

                  Comment


                    #10
                    Hi,

                    works a lot better now, but not in all cases. Please see attached Test.java and the screenshot. Is there maybe a setting that ignores checking overlap and just renders what it gets?

                    thanks


                    Click image for larger version

Name:	smartGWTTimeline.png
Views:	195
Size:	15.1 KB
ID:	259580
                    Attached Files

                    Comment


                      #11
                      The problem here is that one of your events is only 50 seconds long, and there's no space in any of your timelines to represent that, since each pixel is, at the absolute minimum (in your first timeline), representing at least 1 minute, So that event is rendered at the minimum 1px snap. You can test that, by just making your event longer than the minimum representable snapGap.

                      You also, for some reason, are applying a snapGap of 3 minutes, which 1) seems a little bizarre and 2), once again, can not be represented in a 60px column that spans 3 hours. Consider making your columns wider - headerLevel.setHeaderWidth() will do that - but, essentially, you are never going to get this to work as you expect with an event with a length shorter than the minimum snapGap.
                      Last edited by Isomorphic; 7 Oct 2019, 04:11.

                      Comment

                      Working...
                      X