Skip to content

Commit

Permalink
Merge pull request #5595 from gooddata/ach/gen-ai-chart-legend
Browse files Browse the repository at this point in the history
RELATED: F1-645 Chart legend fix
  • Loading branch information
hackerstanislav authored Nov 25, 2024
2 parents fb45b53 + a842a6a commit 20ea4ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const VisualizationContentsComponent: React.FC<VisualizationContentsProps
})()}
</VisualizationErrorBoundary>
</div>
<div className="gd-gen-ai-chat__messages__visualization__title">
<div className="gd-gen-ai-chat__visualization__title">
<MarkdownComponent allowMarkdown={useMarkdown}>
{visualization.title}
</MarkdownComponent>
Expand All @@ -77,6 +77,9 @@ const renderBarChart = (metrics: IMeasure[], dimensions: IAttribute[], filters:
config={{
// Better visibility with stacked bars if there are multiple metrics and dimensions
stackMeasures: metrics.length > 1 && dimensions.length === 2,
legend: {
responsive: "autoPositionWithPopup",
},
}}
filters={filters}
/>
Expand All @@ -91,6 +94,9 @@ const renderColumnChart = (metrics: IMeasure[], dimensions: IAttribute[], filter
config={{
// Better visibility with stacked bars if there are multiple metrics and dimensions
stackMeasures: metrics.length > 1 && dimensions.length === 2,
legend: {
responsive: "autoPositionWithPopup",
},
}}
filters={filters}
/>
Expand All @@ -103,6 +109,11 @@ const renderLineChart = (metrics: IMeasure[], dimensions: IAttribute[], filters:
trendBy={dimensions[0]}
segmentBy={metrics.length <= 1 ? dimensions[1] : undefined}
filters={filters}
config={{
legend: {
responsive: "autoPositionWithPopup",
},
}}
/>
);

Expand Down
1 change: 1 addition & 0 deletions libs/sdk-ui-gen-ai/styles/scss/messages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@

&__title {
text-align: center;
margin-top: 15px;
}
}

Expand Down

0 comments on commit 20ea4ab

Please sign in to comment.