-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fix(plugin-chart-echarts): support adhoc x-axis #20055
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20055 +/- ##
=======================================
Coverage 66.35% 66.35%
=======================================
Files 1712 1712
Lines 64097 64097
Branches 6744 6744
=======================================
Hits 42534 42534
Misses 19850 19850
Partials 1713 1713
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
const index = [getColumnLabel(formData.x_axis || DTTM_ALIAS)]; | ||
return { | ||
operation: 'pivot', | ||
options: { | ||
index: [xAxis || DTTM_ALIAS], | ||
index, |
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.
I'm not sure which is better/more readable, inlining it or declaring it as a variable first. I went with declaring a const
first, but looking at it now I should maybe have inlined it..
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.
I think this looks good 👍
superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts
Outdated
Show resolved
Hide resolved
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.
1 nit, otherwise LGTM!
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.
LGTM!
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.
Nice work!
@villebro great, thanks a lot for fixing! |
* fix(plugin-chart-echarts): support adhoc x-axis * simplify code (cherry picked from commit b53daa9)
* fix(plugin-chart-echarts): support adhoc x-axis * simplify code (cherry picked from commit b53daa9)
* fix(plugin-chart-echarts): support adhoc x-axis * simplify code
SUMMARY
Currently using a Custom SQL expression with the
GENERIC_CHART_AXES
produces unexpected results. Here we ensure all post processing operations that support generic x-axes also support custom SQL adhoc columns. In addition, thetransformProps
of the ECharts Timeseries chart is update to properly handle custom SQL adhoc columns.AFTER
Now the chart renders as expected:
BEFORE
Previously the chart data request returned zero rows:
TESTING INSTRUCTIONS
GENERIC_CHART_AXES
feature flagADDITIONAL INFORMATION