Duration charts with timeline on x-axis

257 views
Skip to first unread message

anthos

unread,
Jan 26, 2010, 7:44:30 PM1/26/10
to Google Visualization API
I am looking for ways to draw a chart with date on y-axis and time on
x-axis to have a task duration of start time to end time plotted
similar to http://pubs.logicalexpressions.com/Pub0009/userimages/ai1408.gif

Can I use Google Visualization API for this purpose ? If so could
someone please provide me a snippet to start with ?

Bug Chart

unread,
Feb 2, 2010, 8:33:52 AM2/2/10
to google-visua...@googlegroups.com
Hi,

there are several ways to achieve this.

    There is a timeline gadget and a gantt gadget which looks similar to what you need.
    They are 3rd party, so I can guarantee anything though.

2: You can sort of hack this with Chart API bar charts: http://code.google.com/apis/chart/types.html#bar_charts
    You can use several data series with white color for the first one.
    Note that you can even wrap this in JS with the generic image chart.

HTH,

BugChart. 

asgallant

unread,
Jul 12, 2012, 8:02:13 PM7/12/12
to google-visua...@googlegroups.com
There is a "cheat" around this.  Create a DataTable with 3 columns; the first contains your domain-axis values, the second sets the distance from the axis that the bar will start, and the third is your data.  In the chart's options, set "IsStacked" to true and "series.0.color" to "transparent" and  "series.0.visibleInLegend" to false.  This creates a chart with two stacked data series where the first series is transparent - the bars don't trigger the tooltips and aren't visible - so it gives the impression that the bars for the second series are "floating."  See an example here: http://jsfiddle.net/asgallant/uHTE8/ 

On Thursday, July 12, 2012 6:40:09 PM UTC-4, Stjepan Brbot wrote:
I need the same thing! The only possibility with Google visualization API is to achieve something similar with CandlestickChart but in vertical direction. It seems that it is not possible to have CandlestickChart in horizontal direction. The CandlestickChart is only one offering start position of bar. Bars in all other chart types start from axis.

Stjepan Brbot

unread,
Jul 13, 2012, 2:39:36 AM7/13/12
to google-visua...@googlegroups.com
Thank you very much for your reply and link on an example. I thought about this solution that you recommended of hiding first bar in stacked barchart as well and it could be a solution. But it is quite inconvenient because if one deals with time periods he/she always has start and end date of periods. With this solution one has to tackle with reorganizing these data to be appropriate for barchart representation (specially if periods are not following each other). However, this is one of workarounds since we don't have a gantt chart in Google Visualization API.
Reply all
Reply to author
Forward
0 new messages