You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "oliwheeler (via GitHub)" <gi...@apache.org> on 2025/08/07 13:16:06 UTC

[I] [Feature] Configurable priority level for displaying X axis labels [echarts]

oliwheeler opened a new issue, #21181:
URL: https://github.com/apache/echarts/issues/21181

   ### What problem does this feature solve?
   
   In some charts, certain labels, e.g the start of the year or month should be prioritized to show over others.
   
   <img width="708" height="239" alt="Image" src="https://github.com/user-attachments/assets/35317847-c418-444f-a8ab-356c71c9abd7" />
   
   
   
   ### What does the proposed API look like?
   
   `xAxis.axisLabel.interval` : `(index:number, value: string) => number`
   
   The higher the number, the higher the priority to show over lower priority ones when `hideOverlap: true`.
   e.g.
   
   ```ts
   const options = {
      xAxis: {
       type: "category",
       interval: (index, value) => {
         if (firstDayOfYear(value))  {
           return 2
         }
         if (firstDayOfMonth(value)) {
           return 1
         }
         return 0
       },
     }
     ...
   }
   ```


-- 
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: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org