Explore: Configure explore series colours via field config (#20239)

This commit is contained in:
Dominik Prokop
2019-11-07 14:58:50 +01:00
committed by GitHub
parent e4afc8d518
commit 225ecd680a
4 changed files with 20 additions and 12 deletions

View File

@@ -149,13 +149,18 @@ export function makeSeriesForLogs(rows: LogRowModel[], intervalMs: number, timeZ
});
const timeField = data.fields[1];
timeField.display = getDisplayProcessor({
config: timeField.config,
type: timeField.type,
isUtc: timeZone === 'utc',
});
const valueField = data.fields[0];
valueField.config = {
...valueField.config,
color: series.color,
};
const graphSeries: GraphSeriesXY = {
color: series.color,
label: series.alias,
@@ -168,7 +173,7 @@ export function makeSeriesForLogs(rows: LogRowModel[], intervalMs: number, timeZ
},
seriesIndex: i,
timeField,
valueField: data.fields[0],
valueField,
// for now setting the time step to be 0,
// and handle the bar width by setting lineWidth instead of barWidth in flot options
timeStep: 0,
@@ -197,7 +202,6 @@ export function dataFrameToLogsModel(dataFrame: DataFrame[], intervalMs: number,
// Create metrics from logs
logsModel.series = makeSeriesForLogs(logsModel.rows, intervalMs, timeZone);
} else {
// We got metrics in the dataFrame so process those
logsModel.series = getGraphSeriesModel(
metricSeries,
timeZone,