-
Notifications
You must be signed in to change notification settings - Fork 426
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
feat: allow styling bar chart series' labels #10958
Conversation
✅ Deploy Preview for peaceful-bassi-cbf284 canceled.
|
// Remove series styling if only one y axis field left | ||
if ( | ||
state.config.fieldConfig.y.length === 1 && | ||
state.config.display?.series | ||
) { | ||
state.config.display.series = undefined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this make sense to you @owlas?
So when there's only one y axis, then there's no extra fields, so we can clear the series styling. LMK if you want this somewhere else
@@ -25,6 25,31 @@ export class BarChartDataTransformer<TBarChartLayout, TPieChartConfig> { | |||
|
|||
const DEFAULT_X_AXIS_TYPE = 'category'; | |||
|
|||
const series = transformedData?.seriesColumns.map( | |||
(seriesColumn, index) => { | |||
const seriesLabel = Object.values(display?.series || {}).find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where I'm a bit confused if I should do it this way @owlas
We want to get the label, we know the series is an object where the key is a reference
and the values include yAxisIndex
Would you do this differently or potentially change the structure of series? 🤔
seriesColumn, | ||
], | ||
type: 'bar', | ||
name: seriesLabel || friendlyName(seriesColumn), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@owlas I'm not sure what to do with this seriesColumn
because when there's no label applied, we default to this which is like "Sum of Customer id", but on the Styling panel we don't have access to that seriesColumn
, so we default to reference, which will be something like customer_id
- what would you do here?
Would you keep this friendlyName(seriesColumn)
and keep the input empty if no override on the styling panel?
Closing due to lack of capacity |
Closes:
Description:
WIP:
change-label.mov
Reviewer actions