Skip to content

Commit 8db158a

Browse files
os-zhuangCopilot
andcommitted
feat(app-crm): demo categoryGranularity month-bucketing on Pipeline Trend
Switch the Pipeline Trend line chart from a 90-day window with raw- timestamp grouping (rendered flat at y=1 because each seed record has a unique close_date) to a 12-month window bucketed by close-month with a previous-year compareTo overlay. Showcases the new `categoryGranularity` widget property delivering real Y-axis variation across the seed dataset. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a5a7d9b commit 8db158a

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

examples/app-crm/dist/objectstack.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,20 +600,19 @@
600600
},
601601
{
602602
"id": "pipeline_trend_90d",
603-
"title": "Pipeline Trend (90d)",
604-
"description": "Daily count of opportunities created in the last 90 days, with a sliding overlay of the prior 90-day window.",
603+
"title": "Pipeline Trend (12 months)",
604+
"description": "Opportunity count bucketed by close-month for the last year, with a sliding overlay of the prior year for compareTo.",
605605
"type": "line",
606606
"object": "crm_opportunity",
607607
"filter": {
608608
"close_date": {
609-
"$gte": "{90_days_ago}",
609+
"$gte": "{1_years_ago}",
610610
"$lte": "{today}"
611611
}
612612
},
613-
"compareTo": {
614-
"offset": "90d"
615-
},
613+
"compareTo": "previousYear",
616614
"categoryField": "close_date",
615+
"categoryGranularity": "month",
617616
"aggregate": "count",
618617
"layout": {
619618
"x": 0,

examples/app-crm/src/dashboards/pipeline.dashboard.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ export const PipelineDashboard: Dashboard = {
8282
{
8383
id: 'pipeline_trend_90d',
8484
type: 'line',
85-
title: 'Pipeline Trend (90d)',
86-
description: 'Daily count of opportunities created in the last 90 days, with a sliding overlay of the prior 90-day window.',
85+
title: 'Pipeline Trend (12 months)',
86+
description: 'Opportunity count bucketed by close-month for the last year, with a sliding overlay of the prior year for compareTo.',
8787
object: 'crm_opportunity',
8888
aggregate: 'count',
8989
categoryField: 'close_date',
90-
categoryGranularity: 'day',
90+
categoryGranularity: 'month',
9191
filter: {
92-
close_date: { $gte: '{90_days_ago}', $lte: '{today}' },
92+
close_date: { $gte: '{1_years_ago}', $lte: '{today}' },
9393
},
94-
compareTo: { offset: '90d' },
94+
compareTo: 'previousYear',
9595
layout: { x: 0, y: 2, w: 8, h: 4 },
9696
},
9797
{

0 commit comments

Comments
 (0)