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

fix(charts): big-number display broken in echarts #24492

Merged

Conversation

anamitraadhikari
Copy link
Contributor

SUMMARY

The current implementation of the time-series charts in ECharts seems to have a limitation in properly rendering big numbers. As a result, the display of big numbers in the chart is broken.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
68d58a51-b0f2-42b0-b191-f35372d8b5dd

After:
19053635-9d5a-42e4-81a0-cd2d7aa51790

TESTING INSTRUCTIONS

To replicate the issue with big number display in time series charts, you can create a time series chart that includes data points with large numeric values. Here is an example SQL query that can be executed in SQL Lab to generate such data:

select 9223372036854775807 as huge_number, 'abc' as str union all
select 9223372036854775807.5 as huge_number, 'foo' as str union all
select 92233720368547758071111 as huge_number, 'bar' as str
  1. After executing the SQL query in SQL Lab and getting the result set, click on the "Create Chart" button.
  2. In the chart creation page, switch to the "LINE CHART" option.
  3. On the chart configuration panel, select the 'str' column for the x-axis.
  4. Add the "SUM(huge_number)" column to the y-axis to represent the aggregated big numbers.
  5. Update the chart to apply the changes and visualize the data.
  6. By performing these steps, you will be able to replicate the issue where the ECharts library struggles to properly render the big number values on the time series chart.

@anamitraadhikari anamitraadhikari marked this pull request as ready for review June 23, 2023 06:01
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, this has been a pain for a long time! A few minor comments.

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #24492 (59aeaed) into master (51a34d7) will increase coverage by 0.03%.
The diff coverage is 65.62%.

❗ Current head 59aeaed differs from pull request most recent head fefa1b9. Consider uploading reports for the commit fefa1b9 to get more accurate results

@@            Coverage Diff             @@
##           master   #24492      +/-   ##
==========================================
+ Coverage   69.01%   69.04%   +0.03%     
==========================================
  Files        1901     1903       +2     
  Lines       74034    74027       -7     
  Branches     8119     8118       -1     
==========================================
+ Hits        51091    51109      +18     
+ Misses      20835    20807      -28     
- Partials     2108     2111       +3     
Flag Coverage Δ
javascript 55.74% <60.37%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../packages/superset-ui-core/src/chart/types/Base.ts 100.00% <ø> (ø)
.../plugins/plugin-chart-echarts/src/BoxPlot/index.ts 50.00% <ø> (ø)
...d/plugins/plugin-chart-echarts/src/Funnel/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Gauge/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Graph/index.ts 50.00% <ø> (ø)
...rts/src/MixedTimeseries/EchartsMixedTimeseries.tsx 0.00% <ø> (ø)
.../plugin-chart-echarts/src/MixedTimeseries/index.ts 25.00% <ø> (ø)
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
...tend/plugins/plugin-chart-echarts/src/Pie/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Radar/index.ts 50.00% <ø> (ø)
... and 33 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@michael-s-molina
Copy link
Member

@justinpark I know that you fixed similar problems recently. Could you review this PR?

@villebro villebro closed this Jun 27, 2023
@villebro villebro reopened this Jun 27, 2023
@villebro villebro requested a review from kgabryje June 27, 2023 16:12
@villebro villebro merged commit 3f17945 into apache:master Jun 27, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Co-authored-by: aadhikari <aadhikari@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants