powerbi - Deneb Gantt 2.0 - add "Quarters" button? - Stack Overflow

admin2025-04-29  2

I'm trying to add a Quarters button alongside the existing Days, Months, and Years time period buttons in David Bacci/s Gantt 2.0.

I've made some progress and had some issues. I need to fix the Months and Quarters, so that when click and wheel, the gantt chart clearly switches to the respective month and quarter views, and transition in correct order.

Currently, when click, Months and Quarters stick together and behave like a single button (both act like Quarters). And when wheel to zoom, it goes in the wrong order: day-(month)-quarter-month-year.

Here is what I've done so far Vega editor with my modified codes

I'm trying to add a Quarters button alongside the existing Days, Months, and Years time period buttons in David Bacci/s Gantt 2.0.

I've made some progress and had some issues. I need to fix the Months and Quarters, so that when click and wheel, the gantt chart clearly switches to the respective month and quarter views, and transition in correct order.

Currently, when click, Months and Quarters stick together and behave like a single button (both act like Quarters). And when wheel to zoom, it goes in the wrong order: day-(month)-quarter-month-year.

Here is what I've done so far Vega editor with my modified codes

Share Improve this question asked Jan 6 at 23:25 ZoeZZoeZ 11 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 0

Define the time range for a quarter, adjusting the zoom behavior, and ensuring smooth transitions between views:

"quarterExt",
"update": "[data('xExt')[0]['s']-oneDay, data('xExt')[0]['s'] + (ganttWidth / 1.5) * oneDay * 90]"

In that vein, I played a little with the monthExt, QuarterExt, and modified as below. It appears to work.

{
  "name": "monthExt",
  "update": "[data('xExt')[0]['s']-oneDay ,data('xExt')[0]['s'] + ((ganttWidth-minDayBandwidth)/minDayBandwidth)*2*oneDay]"
},
{
  "name": "quarterExt",
  "update": "[data('xExt')[0]['s']-oneDay, data('xExt')[0]['s'] + ((ganttWidth-minMonthBandwidth)/minMonthBandwidth)*1.5*oneDay]"
},
转载请注明原文地址:http://anycun.com/QandA/1745939479a91400.html