cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
cancel
Showing results for 
Search instead for 
Did you mean: 

Gantt chart in dashboard

Amy
New Contributor II

I'd like to create Gantt charts using the dashboard function. It seems like this could be possible by adding some additional parameters in the bar plot functionality, but I don't see how to do it currently (if there is a way, would love an example!).

In altair, this chart type is based on the bar plot, with an additional parameter `x2` that tells where to end the bar.

Example (from altair😞

Screen Shot 2022-06-23 at 1.48.05 PM 

import altair as alt
import pandas as pd
 
source = pd.DataFrame([
    {"task": "A", "start": 1, "end": 3},
    {"task": "B", "start": 3, "end": 8},
    {"task": "C", "start": 8, "end": 10}
])
 
alt.Chart(source).mark_bar().encode(
    x='start',
    x2='end',
    y='task'
)

5 REPLIES 5

Kaniz
Community Manager
Community Manager

Hi @Amy Shapiro​,

Plotly Express is the easy-to-use, high-level interface to Plotly, which operates on various types of data and produces easy-to-style figures. With a px.timeline(introduced in version 4.9), each data point is represented as a horizontal bar with a start and end point specified as dates.

By default, the px.timeline function sets the X-axis to be type=date so it can be configured like any time-series chart.

Plotly Express also supports a general-purpose px.bar function for bar charts.

imageFor more modifications, please have a read at this article.

Amy
New Contributor II

Hi @Kaniz Fatma​ ,

Thanks for the response. I use altair for plotting, and as you can see I can easily make the Gantt chart in python in altair using the above code. I'm specifically asking about getting this in the dashboard functionality of Databricks, which seems like it only supports Databricks plotting. Is it possible to use python to create dashboards?

Thanks,

Amy

Kaniz
Community Manager
Community Manager

Hi @Amy Shapiro​  Let me check and get back to you.

Vidula
Honored Contributor

Hi @Amy Shapiro​ 

Hope you are doing great!

I just wanted to check in if you were able to resolve your issue or do you need more help. We'd love to hear from you.

Thanks!

alexiswl
Contributor

Hi @Vidula,

I don't think this has been resolved.  

I think gantt charts would look fantastic in a Lakeview Dashboard.  

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.