mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Migrating color pickers to Popper from drop.js pt1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user