Create a timeline and plot details on this timeline

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kennyang
    New Member
    • Dec 2010
    • 5

    Create a timeline and plot details on this timeline

    Hi all,

    I have a database that logs certain events on my simulation. I need to create a timeline using VB then get the events from the database and plot them according to the log time that is stored in the database.

    eventually the timeline will contain all the events according to the log time in the database and they will have details on each time plot.

    Any idea how to start? was looking at MSchart but not something that i have in mind.

    thanks in advance
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    First put the data from the database in an array.
    With this data You can write the code for the visualization of Your own chart layout.

    Some questions to start:
    Q1 Is it possible to attach in Bytes a GIF file or screen capture (a simple sketch) of the layout You want to see so we can have an idea in which direction we have to think?
    (I have attached an example created with Paint).
    Q2 Is it possible to attach an example of the data ?
    Is it text ? how much char's,...
    Q3 Must all the data be visible at once or if the mouse moves over the data-points, ...?
    Attached Files

    Comment

    • kennyang
      New Member
      • Dec 2010
      • 5

      #3
      hi,

      the data would be something like this:

      (LogTime, Action)
      8:00:000, "BusID 1 Leaves Depot"
      8:01:050, "BusID 1 stops at Bus stop A"
      8:05:000, "BusID 1 Leaves bus stop A"

      I hope to have the actions pointed to the timeline according to their logTime. The user can zoom in and out of the timeline to view the details.

      the timeline can look something like what u have attached.

      I was wondering if there are any timeline control that i can make use of in VB. Thanks!

      Comment

      • Guido Geurs
        Recognized Expert Contributor
        • Oct 2009
        • 767

        #4
        Sorry but I don't see an attachment.
        To attach in Bytes:
        [Go Advanced] - [Manage attachments]

        Comment

        • kennyang
          New Member
          • Dec 2010
          • 5

          #5
          hi,

          I have uploaded a simple timeline. if the information gets too cluttered, the user can zoom in and out of it to view the details.

          any current timeline in vb that i can make use of? if possible i hope to make use of certain .ocx that is available.
          Attached Files

          Comment

          • Guido Geurs
            Recognized Expert Contributor
            • Oct 2009
            • 767

            #6
            I have googled and found nothing we can use.
            To build a custom timeline is not such a big deal: analyze how You want it and calculate the points of the elements(lines, datalabels,...) .

            I have done some brainstorming (maybe more storm than brains) but anyhow, we must start with some questions:

            Q1: is it necessary to have a horizontal timeline?
            Because a vertical one has better possibilities for setting the labels (see attached GIF).
            Maybe no need to zoom to read the data?

            Q2: How many datalines are there mostly in a timeline ? 10 ? 50 ? 100 ? 200 ?...

            Q3: Are the coordinates of the timeline always the same:
            From 8:00 to 17:00
            Or are they fluctuating:
            once 8:00 to 17:00
            next 9:30 to 18:30
            next 1:00 AM to 9:00 AM
            next 22:00 to 7:00 AM next day ???

            Q4: In the data, the time is represented by "8:01:050".
            I suppose that 8= hours, 01 = minutes and 050 are thousands of seconds ???
            Is it necessary the work with 1/1000 of a second ?
            It can be set in the label but I suppose it's not relevant for the timeline?
            Calculating the coordinates on hours and minutes will be enough ?

            Q5: I have placed the data in a textfile for myself for developing and testing the program.
            At startup I read the data in an array.
            I suppose it's no problem for You to read the data from Your database into the array so we can work further in the program on the data in the array? (see attachment)
            Attached Files

            Comment

            • Guido Geurs
              Recognized Expert Contributor
              • Oct 2009
              • 767

              #7
              These are the first tests.
              It's with a vertical scale but for a horizontal one it's only calculating the LEFT instead of the TOP of the elements.
              The datalabels are still overlapping but with a zoom of the hole scale can solve that.
              Whats Your suggestions and remarks ?
              Attached Files

              Comment

              • Guido Geurs
                Recognized Expert Contributor
                • Oct 2009
                • 767

                #8
                It's also possible to stack the labels and (or) let the user place them. (see attachment)
                Attached Files

                Comment

                • kennyang
                  New Member
                  • Dec 2010
                  • 5

                  #9
                  hi,

                  I have not really looked at your codes yet. appreciate your help =).

                  My way of doing:
                  its not efficient coding but i will just use it if it works.
                  i load my data into a sqlDataAdpater. Then create a panel to act as the timeline. i did a difference between the last time and the start time, then divide them by the width of the panel. now i will have the number of seconds represented by each pixel. so buy doing some calculation i draw my lines and plot the events on this time line.

                  still working on the zooming in of the information. will post some pics when available. Thanks once again.

                  Comment

                  • Guido Geurs
                    Recognized Expert Contributor
                    • Oct 2009
                    • 767

                    #10
                    No need to ZOOM (resize) the label!
                    Just use two labels: a label Minimum size with nothing in and a Label with all the data.
                    Just flip-Flop on "Visible" beween the two labels.
                    The user gets the impression that it zooms!

                    See attachment:
                    - Click on the labelData or LabelDataMin with the right mouse button to +zoom or -zoom.
                    - Click with Left mouse button on the full sized label (LabelData) and drag-drop it to replace the label.

                    Comment

                    • kennyang
                      New Member
                      • Dec 2010
                      • 5

                      #11
                      Hi

                      I don't see any attachments. could u reattach?

                      Comment

                      • Guido Geurs
                        Recognized Expert Contributor
                        • Oct 2009
                        • 767

                        #12
                        Sorry.
                        Attached is:
                        - v1.5 with "replace labelMIN <> labelMAX" (= RMB) and "Move" (= LMB).
                        - v2.0 with "zoom+ <> zoom-" (= RMB) and "Move" (= LMB).
                        Attached Files

                        Comment

                        Working...