Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histogram: Fix 'combine' option & legend rendering #84026

Merged
merged 3 commits into from Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -479,10 +479,14 @@ export function buildHistogram(frames: DataFrame[], options?: HistogramTransform
counts = [
{
...counts[0],
name: 'count',
name: 'Count',
values: vals,
type: FieldType.number,
state: undefined,
state: {
...counts[0].state,
displayName: 'Count',
origin: { frameIndex: 0, fieldIndex: 2 },
},
},
];
} else {
Expand Down
4 changes: 3 additions & 1 deletion public/app/plugins/panel/histogram/Histogram.tsx
Expand Up @@ -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) {
Expand Down