Skip to content

Commit

Permalink
Fix the color of the serie in the comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
jsers committed May 13, 2020
1 parent ecb8750 commit 4d08dd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/components/Graph/Graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Graph extends Component<Props, State> {
chartOptions = config.chart;
headerHeight = 35;
counterList = [];
series = [];
series = [] as any[];
state = {
spinning: false,
errorText: '',
Expand Down
8 changes: 5 additions & 3 deletions web/src/components/Graph/util/normalizeSeries.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import _ from 'lodash';
import { hexPalette } from '../config';
import { SerieInterface } from '../interface';
import { SerieInterface, GraphDataInterface } from '../interface';

export default function normalizeSeries(data: any[]) {
export default function normalizeSeries(data: any[], graphConfig: GraphDataInterface): SerieInterface[] {
const { comparison } = graphConfig;
const isComparison = !!_.get(comparison, 'length', 0);
const series = [] as SerieInterface[];
_.each(_.sortBy(data, ['counter', 'endpoint']), (o, i) => {
const { endpoint, comparison } = o;
const color = getSerieColor(o, i);
const color = getSerieColor(o, i, isComparison);
const separatorIdx = o.counter.indexOf('/');

let counter = endpoint ? '' : o.counter;
Expand Down

0 comments on commit 4d08dd4

Please sign in to comment.