Migrating color pickers to Popper from drop.js pt1

This commit is contained in:
Dominik Prokop
2019-01-18 09:47:39 +01:00
parent c74b39696c
commit 33fa40a1f3
9 changed files with 207 additions and 214 deletions

View File

@@ -1,6 +1,7 @@
import kbn from 'app/core/utils/kbn';
import { getFlotTickDecimals } from 'app/core/utils/ticks';
import _ from 'lodash';
import { ColorDefinition } from '@grafana/ui/src/utils/colorsPalette';
function matchSeriesOverride(aliasOrRegex, seriesAlias) {
if (!aliasOrRegex) {
@@ -356,8 +357,13 @@ export default class TimeSeries {
return false;
}
setColor(color) {
this.color = color;
this.bars.fillColor = color;
setColor(color: string | ColorDefinition) {
if (typeof color === 'string') {
this.color = color;
this.bars.fillColor = color;
} else {
this.color = color.variants.dark;
this.bars.fillColor = color.variants.dark;
}
}
}