mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
Histogram: Fix 'combine' option & legend rendering (#84026)
This commit is contained in:
parent
61f6c4f84d
commit
8b9bc9a919
@ -482,7 +482,12 @@ export function buildHistogram(frames: DataFrame[], options?: HistogramTransform
|
||||
name: 'count',
|
||||
values: vals,
|
||||
type: FieldType.number,
|
||||
state: undefined,
|
||||
state: {
|
||||
...counts[0].state,
|
||||
displayName: 'Count',
|
||||
multipleFrames: false,
|
||||
origin: { frameIndex: 0, fieldIndex: 2 },
|
||||
},
|
||||
},
|
||||
];
|
||||
} else {
|
||||
|
@ -312,7 +312,9 @@ export class Histogram extends React.Component<HistogramProps, State> {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <PlotLegend data={this.props.rawSeries!} config={config} maxHeight="35%" maxWidth="60%" {...legend} />;
|
||||
const frames = this.props.options.combine ? [this.props.alignedFrame] : this.props.rawSeries!;
|
||||
|
||||
return <PlotLegend data={frames} config={config} maxHeight="35%" maxWidth="60%" {...legend} />;
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: HistogramProps) {
|
||||
|
Loading…
Reference in New Issue
Block a user