Forum Discussion

AlB's avatar
AlB
Icon for Community Champion rankCommunity Champion
4 years ago

Visual simultaneous events

Hi all,

We want to have a visual similar to the one below so that we can see where users were active simultaneously. Each row on the y axis is a different user, the x axis is time and the yellow bars show the time period(s) on which a user was active in the system.

Can you recommend a visual capable of this?

Note we will need a slicer on datetime (x-axis) to allow the user to concentrate on a specific period

Thanks      

 

 

 

 

12 Replies

  • Hey AlB ,

     

    currently I'm considering each data visualization task being a nail and deneb the hammer:
    https://deneb-viz.github.io/

    Maybe these examples provide you with an idea what can be done

    I cosnider deneb or being more precise vega and vega-lite on par with seaborn and ggplot2 (maybe not fully on par) but deneb bring the interactivit to the table that r and python charts are completely missing.

     

    Hopefully this provides some ideas.

     

    Regards,

    Tom

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    I agree with TomMartens . Deneb can be used for this one with the "tick" "mark". I am glad to try it out, if you provide some sample data.

    Pat

     

    • mahoneypat's avatar
      mahoneypat
      Icon for Microsoft Employee rankMicrosoft Employee

      I missed that you had start/end times, so used a "rect" mark instead (so an "x2" value could be provided). How does this look? If it works, the "spec" is below that you can copy/paste into your Deneb visual. There is a lot more you can do with the formatting of course.

       

      {
      "data": {"name": "dataset"},
      "mark": {"type": "rect"},
      "encoding": {
      "y": {
      "field": "User",
      "type": "nominal",
      "axis": {"title": null}
      },
      "x": {
      "field": "StartDateTime",
      "type": "temporal",
      "axis": {"title": "DateTime"}
      },
      "x2": {"field": "EndDateTime"}
      }
      }


      Pat

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Thanks mahoneypat 

    That gets me pretty close. I was playing with it and would need to change a couple of things that i haven't been able to:

    1. Change the color of the bars

    2. Can the visual be sorted by one of its fields?

    3. I have a tooltip now but would like it to show User first instead of after StartTime. Can that be changed?

    I'm attaching a pbix with your Vega code in a Deneb visual and the events data

    Thanks  a lot

    • mahoneypat's avatar
      mahoneypat
      Icon for Microsoft Employee rankMicrosoft Employee

      Please see the attached that addresses:

      • Specifying fields and the display order for the tooltip. Note that a "format" is also needed to get the the datetime values to show in full
      • Specify a different "color" for the "mark" or using the User field in "encoding" (two different tabs; not sure which one you wanted)
      • Sorting by a field. I didn't see an additional field, so I sorted by User descending to demonstrate the syntax.

      Pat

       

      • Br1-981's avatar
        Br1-981
        Icon for Helper I rankHelper I

        mahoneypat Very useful, thanks for letting me discovering this visual, literally saved my day!

        Do you know if is it possible to remove completely the legend?
        Do you have further documentation about it?

        Thanks in advance

         

        Bruno