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

   <!-- Answer -->
   Superset currently does not automatically exclude future or empty years from 
the X-axis in time-series charts. The frontend chart logic prepares axis 
intervals based on the selected time grain and dataset, but does not filter out 
years with no data by default. You can manually restrict the axis range using 
the `xAxisBounds` chart option, or filter your dataset to only include years 
with data if you want to avoid showing empty/future intervals [code 
reference](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts).
   
   There is a feature that lets you force the selected time grain for X-axis 
intervals via a checkbox in the chart controls, which may help with axis label 
consistency but does not filter out empty years [pull 
request](https://github.com/apache/superset/pull/34595). The X-axis time format 
is also configurable in the control panel [pull 
request](https://github.com/apache/superset/pull/34436).
   
   For now, the most reliable workaround is to filter your dataset or set axis 
bounds to restrict the X-axis to only the years with data.
   
   
   <!-- 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/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/ab77464d-c0d4-4c37-86d1-eb3c868dbd20?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Superset%20currently%20does%20not%20automatically%20exclude%20future%20or%20empty%20years%20from%20the%20X-axis%20in%20time-series%20charts.%20The%20frontend%20chart%20logic%20prepares%20axis%20intervals%20based%20on%20the%20selected%20time%20grain%20and%20dataset%2C%20but%20does%20not%20filter%20out%20years%20with%20no%20data%20by%20default.%20You%20can%20manually%20restrict%20the%20axis%20range%20using%20the%20%60xAxisBounds%60%20chart%20option%2C%20or%20filter%20your%20dataset%20to%20only%20include%20years%20with%20data%20if%20you%20want%20to%20avoid%20showing%20empty/future%20intervals%C2%A0%5Bcode%20reference%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts%29
 
.%0A%0AThere%20is%20a%20feature%20that%20lets%20you%20force%20the%20selected%20time%20grain%20for%20X-axis%20intervals%20via%20a%20checkbox%20in%20the%20chart%20controls%2C%20which%20may%20help%20with%20axis%20label%20consistency%20but%20does%20not%20filter%20out%20empty%20years%C2%A0%5Bpull%20request%5D%28https%3A//github.com/apache/superset/pull/34595%29.%20The%20X-axis%20time%20format%20is%20also%20configurable%20in%20the%20control%20panel%C2%A0%5Bpull%20request%5D%28https%3A//github.com/apache/superset/pull/34436%29.%0A%0AFor%20now%2C%20the%20most%20reliable%20workaround%20is%20to%20filter%20your%20dataset%20or%20set%20axis%20bounds%20to%20restrict%20the%20X-axis%20to%20only%20the%20years%20with%20data.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20
 issue!&url=https%3A//github.com/apache/superset/issues/37661)


-- 
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