dosubot[bot] commented on issue #37038: URL: https://github.com/apache/superset/issues/37038#issuecomment-3736743043
<!-- Answer --> Comma-based D3 format specifiers like `,.2f` should work for Table charts in Superset, as the formatting pipeline passes your format string directly to the D3 formatter, which supports thousands separators by default [reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-core/src/number-format/D3FormatConfig.ts). If it's not working, here are the most common reasons and steps to troubleshoot: 1. **Column type**: Only columns classified as numeric/metric (or percent metric) get D3 formatting. If your column is not recognized as numeric, it will display raw values [reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts#L199-L302). 2. **Dataset-level overrides**: If your dataset has a default format for the column, it can override the chart-level format. Try removing or adjusting the dataset-level format to let your custom chart setting take effect [reference](https://github.com/apache/superset/discussions/35781). 3. **Currency config conflicts**: If a currency format is set for the column, it may override the D3 format. An empty currency config allows D3 formatting to apply [reference](https://github.com/apache/superset/issues/34295). 4. **Frontend cache**: If you recently changed formatting settings, clear your browser cache and restart Superset services to ensure changes are applied [reference](https://github.com/apache/superset/issues/34295). 5. **Chart controls**: Use the "Customize columns" panel in the Table chart controls to set the D3 format string (e.g., `,.2f`) for each metric or column you want formatted with commas [reference](https://github.com/apache/superset/discussions/36852). To verify your config is loaded, inspect `window.bootstrap_data.common.d3_format` in your browser devtools on any Superset page. If your custom format isn't there, Superset isn't loading your config [reference](https://github.com/apache/superset/issues/34295). Exports (CSV/Excel) may not respect UI formatting, but standard frontend display should [reference](https://github.com/apache/superset/discussions/34553). If you check these areas and still see issues, let me know what you find—there may be a subtle config or type issue at play. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/256b7e44-2862-4cdd-ad97-5d5d24bef2db?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Comma-based%20D3%20format%20specifiers%20like%20%60%2C.2f%60%20should%20work%20for%20Table%20charts%20in%20Superset%2C%20as%20the%20formatting%20pipeline%20passes%20your%20format%20string%20directly%20to%20the%20D3%20formatter%2C%20which%20supports%20thousands%20separators%20by%20default%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-core/src/number-format/D3FormatConfig.ts%29.%20If%20it%27s%20not%20working%2C%20here%20are%20the%20most%20common%20reasons%20and%20steps%20to%20troubleshoot%3A%0A%0A1.%20%2A%2AColumn%20type%2A%2A%3A%20Only%20columns%20classified%20as%20numeric/metric%20%28or%20percent%20metric%29%20get%20D3%20formatting.%20If%20your%20colu mn%20is%20not%20recognized%20as%20numeric%2C%20it%20will%20display%20raw%20values%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts%23L199-L302%29.%0A2.%20%2A%2ADataset-level%20overrides%2A%2A%3A%20If%20your%20dataset%20has%20a%20default%20format%20for%20the%20column%2C%20it%20can%20override%20the%20chart-level%20format.%20Try%20removing%20or%20adjusting%20the%20dataset-level%20format%20to%20let%20your%20custom%20chart%20setting%20take%20effect%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/discussions/35781%29.%0A3.%20%2A%2ACurrency%20config%20conflicts%2A%2A%3A%20If%20a%20currency%20format%20is%20set%20for%20the%20column%2C%20it%20may%20override%20the%20D3%20format.%20An%20empty%20currency%20config%20allows%20D3%20formatting%20to%20apply%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/34295%29.%0A4.%20%2A%2AFrontend%20cache%2A%2 A%3A%20If%20you%20recently%20changed%20formatting%20settings%2C%20clear%20your%20browser%20cache%20and%20restart%20Superset%20services%20to%20ensure%20changes%20are%20applied%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/34295%29.%0A5.%20%2A%2AChart%20controls%2A%2A%3A%20Use%20the%20%22Customize%20columns%22%20panel%20in%20the%20Table%20chart%20controls%20to%20set%20the%20D3%20format%20string%20%28e.g.%2C%20%60%2C.2f%60%29%20for%20each%20metric%20or%20column%20you%20want%20formatted%20with%20commas%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/discussions/36852%29.%0A%0ATo%20verify%20your%20config%20is%20loaded%2C%20inspect%20%60window.bootstrap_data.common.d3_format%60%20in%20your%20browser%20devtools%20on%20any%20Superset%20page.%20If%20your%20custom%20format%20isn%27t%20there%2C%20Superset%20isn%27t%20loading%20your%20config%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/issues/34295%29.%0A%0AExports%20%28CSV/Excel%29%20may%20not%20 respect%20UI%20formatting%2C%20but%20standard%20frontend%20display%20should%C2%A0%5Breference%5D%28https%3A//github.com/apache/superset/discussions/34553%29.%0A%0AIf%20you%20check%20these%20areas%20and%20still%20see%20issues%2C%20let%20me%20know%20what%20you%20find%E2%80%94there%20may%20be%20a%20subtle%20config%20or%20type%20issue%20at%20play.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37038) -- 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]
