dosubot[bot] commented on issue #33556:
URL: https://github.com/apache/superset/issues/33556#issuecomment-2900100640

   <!-- Answer -->
   Your analysis about JavaScript's safe integer limit is correct: numbers 
above 9,007,199,254,740,991 (Number.MAX_SAFE_INTEGER) can lose precision in 
JavaScript, which can affect chart rendering in libraries like D3.js or 
ECharts. However, your value (1,059,940,745,468,673) is 15 digits and still 
within the safe integer range, so it should not lose precision due to JS limits 
alone.
   
   There are known issues in Superset where large numbers—especially those 
stored as NUMERIC/DECIMAL types in databases—may be converted to strings or 
mishandled during chart rendering, causing them to be omitted or displayed 
incorrectly. One effective workaround is to cast your numeric columns to BIGINT 
in your SQL query. This ensures Superset treats them as integers and renders 
all chart segments correctly. For example:
   
   ```sql
   SELECT column_name, SUM(CAST(numeric_column AS BIGINT)) as sum_value
   FROM your_table
   GROUP BY column_name
   ```
   
   This approach has been shown to resolve similar issues with large values in 
pie charts and other visualizations in Superset 
[[source]](https://github.com/apache/superset/issues/33174).
   
   There have also been regressions and fixes related to BIGINT and large 
number rendering in Superset's charting code and ECharts plugin 
[[source]](https://github.com/apache/superset/blob/master/superset-frontend/CHANGELOG.md),
 so if you are on an older version, you may want to check if upgrading helps.
   
   In summary: your number is within JS's safe integer range, but casting to 
BIGINT in your query is a recommended workaround for large-value rendering 
issues in Superset charts.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention 
@dosu-bot.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/35ce2c9f-fe0f-4c13-ba02-97c891cd159f?feedback_type=other)</sup>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to