Skip to main content

Posts

Showing posts with the label gantt chart

Defining Link for Gantt Chart

If you have worked with Gantt Chart, you may have noticed that it does not support "Link" feature where as other chart types support it. This is because Gantt chart is based on ojGantt API which does not support link feature, where as other chart types uses ojChart API and ojChart does support "Link" feature. Luckily, Gantt charts supports " selection " feature and we can use this feature to implement (mimic) link feature. To demonstrate this, let's considered a simple use case "Whenever user clicks on task bar, then we need to take user to 'Edit Task' page". To implement this, first, we need to enable "selection" feature on Gantt chart. By default, this option is disabled. For this, we need to write below JavaScript code in "Gantt Chart > Attributes > Advanced > JavaScript Initialization Code" section. Gantt Chart JavaScript Initialization Code function (options) { options.selectionMode = "single...

Oracle APEX Gantt Charts - Custom Tooltips

For showing tooltips on Gantt Charts, just go to "Gantt Chart > Attributes > Tooltip" and select "Yes" for "Show" option. However, this will show standard tooltip and there is no option for customization. In APEX ver. 20.1, there are few more granular options to control on data we want to display in the tooltip. However, still we need to choose from existing options. Luckily, we can implement custom tooltips in relatively easy way. If you are new to Gantt charts, I recommend you to read  Few tips on Gantt Charts  blogpost first. Gantt Chart Options First, we need to specify JavaScript function name, which will return a tooltip element, in the Gantt chart options. In below code "showCustomTooltip" is JavaScript function which return the tooltip element. function (options) {   options.tooltip = {"renderer":showCustomTooltip};   // with older APEX (JET) versions use below code   // options.tooltip = showCustomTooltip;   return option...

Few Tips on Gantt Charts - Part 2

In one of my previous blog post,  Few tips on Gantt Charts , I have explained how you can create Gantt chart to show employees calendar data. In this blog post, I am going to explain two more tips on the Gantt chart. This is continuation of previous blog post. So, if you have not read it yet, I recommend to read it first and then come here. Vertical Grid for Minor Axis If you go to Gantt Chart > Attributes, there you can enable vertical and horizontal grid lines using "Show Vertical Grid" and "Show Horizontal Grid" options. In our example, horizontal grid lines displays a line after every employee row. This looks good. However, vertical grid lines are displayed based on "Major Axis". So if "months" are displayed as scale for major axis, then vertical grid line is displayed after every month. However, it will be helpful if we display vertical grid line after every day (minor axis), especially when there are several employees in the Gantt chart....

Few tips on Gantt Charts

Oracle APEX offers several beautiful chart types which are based on Oracle JET Data Visualizations. Gantt Chart is one such beautiful and useful chart. However, when I have searched in Google for some help on Gantt Charts, there are not many blogs posts talking about it. So, I thought, I could write one with few basic tips which I have learned this year. I have used Gantt Chart to display employees calendar data and my targeted output was something like below. Pic-1 Looks simple, correct? However, it's little tricky to get there. Multiple Tasks Per Row: When I look at the output, first I thought, I will have to write a query which gives tasks data and employee data with 1 row per task. That is, if there are 10 tasks to be displayed, then there should be 10 rows in SQL query output. But, it's not correct. Instead, I should have 1 row for each task + 1 row for each employee (parent). So I need to write a query which will output data in below format. Pic-2 A...