diff --git a/src/panel/graph_panel/controllers/analytic_controller.ts b/src/panel/graph_panel/controllers/analytic_controller.ts
index d5c600c..65cf5c9 100644
--- a/src/panel/graph_panel/controllers/analytic_controller.ts
+++ b/src/panel/graph_panel/controllers/analytic_controller.ts
@@ -696,8 +696,11 @@ export class AnalyticController {
.forEach(unit => unit.inspect = false);
}
- public async updateSeasonality(id: AnalyticUnitId) {
+ public async updateSeasonality(id: AnalyticUnitId, value?: number) {
const analyticUnit = this._analyticUnitsSet.byId(id) as AnomalyAnalyticUnit;
+ if(value !== undefined) {
+ analyticUnit.seasonalityPeriod.value = value;
+ }
await this.saveAnalyticUnit(analyticUnit);
}
diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts
index 60dc7ef..700a607 100644
--- a/src/panel/graph_panel/graph_ctrl.ts
+++ b/src/panel/graph_panel/graph_ctrl.ts
@@ -682,8 +682,8 @@ class GraphCtrl extends MetricsPanelCtrl {
this.refresh();
}
- onSeasonalityChange(id: AnalyticUnitId) {
- this.analyticsController.updateSeasonality(id);
+ onSeasonalityChange(id: AnalyticUnitId, value?: number) {
+ this.analyticsController.updateSeasonality(id, value);
this.refresh();
}
diff --git a/src/panel/graph_panel/partials/tab_analytics.html b/src/panel/graph_panel/partials/tab_analytics.html
index b4f0792..6b04f39 100644
--- a/src/panel/graph_panel/partials/tab_analytics.html
+++ b/src/panel/graph_panel/partials/tab_analytics.html
@@ -253,8 +253,9 @@