fix(time-axis): resolve TypeError when using customValues with formatter on time axis
Root Cause:
- customValues creates basic ScaleTick objects without time property
- TimeScale formatter code assumed tick.time always exists
- Accessing tick.time.level and tick.time.upperTimeUnit without null checks
Solution Applied:
1. src/util/time.ts:346 - Added null check: level: tick.time ? tick.time.level : 0
2. src/scale/Time.ts:208-212 - Wrapped tick.time access in conditional: if (tick.time) { ... }
Testing:
- Created test/customFormat.html with enhanced styling and custom labels
- Verified fixes work correctly with customValues + formatter combination
Impact:
- Resolves GitHub issue with customValues + formatter combination
- Maintains backward compatibility for existing time axis functionality
- Enables proper custom tick positioning with formatted labels on time axes S
Srajan-Sanjay-Saxena committed
3010cb8795ae6c022810c6876d47dc0b4b98fb44
Parent: 6f305b4