Skip to content

Commit 8343397

Browse files
committed
Fix calendar title when using annotation mode and showAnnotationOfAllTargets
When using: ``` mode: annotation showAnnotationOfAllTargets: true ``` The title will be set to "All Targets" and will not be clickable
1 parent bfb869a commit 8343397

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/month.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ function renderMonthHeader(
295295

296296
headerHeight += headerYearSize.height;
297297

298+
if (monthInfo.mode === "annotation" && monthInfo.showAnnotationOfAllTargets && monthInfo.dataset.length > 1) {
299+
datasetName = "All Targets"
300+
}
301+
298302
// dataset rotator
299303
let datasetNameSize = helper.measureTextSize(
300304
datasetName,
@@ -313,8 +317,9 @@ function renderMonthHeader(
313317
")"
314318
)
315319
.attr("class", "tracker-month-title-rotator")
316-
.style("cursor", "pointer")
317-
.on("click", function (event: any) {
320+
.style("cursor", "pointer");
321+
if (!monthInfo.showAnnotationOfAllTargets || monthInfo.mode !== "annotation") {
322+
datasetRotator.on("click", function (event: any) {
318323
// show next target
319324
if (toNextDataset(renderInfo, monthInfo)) {
320325
// clear circles
@@ -329,6 +334,7 @@ function renderMonthHeader(
329334
);
330335
}
331336
});
337+
}
332338
chartElements["rotator"] = datasetRotator;
333339

334340
// value monitor

0 commit comments

Comments
 (0)