Browse Source

Choosing custom color for analytic unit #31 (#40)

master
sanke1 7 years ago committed by rozetko
parent
commit
b4097dc1c9
  1. 2
      src/controllers/analytic_controller.ts
  2. 4
      src/module.ts
  3. 2
      src/partials/tab_analytics.html

2
src/controllers/analytic_controller.ts

@ -170,7 +170,7 @@ export class AnalyticController {
return this._analyticUnitsSet.items;
}
onAnomalyColorChange(id: AnalyticUnitId, value) {
onAnalyticUnitColorChange(id: AnalyticUnitId, value: string) {
this._analyticUnitsSet.byId(id).color = value;
}

4
src/module.ts

@ -530,11 +530,11 @@ class GraphCtrl extends MetricsPanelCtrl {
this.render(this.seriesList);
}
onColorChange(id: AnalyticUnitId, value) {
onColorChange(id: AnalyticUnitId, value: string) {
if(id === undefined) {
throw new Error('id is undefined');
}
this.analyticsController.onAnomalyColorChange(id, value);
this.analyticsController.onAnalyticUnitColorChange(id, value);
this.render();
}

2
src/partials/tab_analytics.html

@ -31,7 +31,7 @@
<span class="gf-form-label">
<color-picker
color="analyticUnit.color"
onChange="ctrl.onAnomalyColorChange.bind(ctrl, analyticUnit.id)"
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id)"
/>
</span>

Loading…
Cancel
Save