You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "MariaChudo (via GitHub)" <gi...@apache.org> on 2025/11/06 13:08:29 UTC
[I] [Bug]Incorrect display of dates on the time axis [echarts]
MariaChudo opened a new issue, #21343:
URL: https://github.com/apache/echarts/issues/21343
### Version
6.0.0
### Link to Minimal Reproduction
https://codepen.io/Mimoza19/pen/ByorrNv
### Steps to Reproduce
Hello.
After upgrading from version 5 to version 6, the customValues: [...ds] property in the xAxis configuration stopped working:
xAxis[i].axisLabel = {
...xAxis[i].axisLabel,
hideOverlap: true,
customValues: [...ds],
formatter: (value) => formatDateAxis(xAxis, value, i),
};
This property was essential for my time-type axis because, without it, the axis labels corresponding to the dates in my dataset are not displayed. For example, my data looks like this:
data = [
{ category: '2024-01-05', value1: 90, value2: 42, value3: 78, value4: 1055 },
{ category: '2024-02-07', value1: null, value2: 0, value3: 45, value4: 1189 },
{ category: '2024-03-09', value1: 64, value2: 34, value3: 58, value4: 1034 },
{ category: '2024-04-12', value1: 0, value2: 40, value3: null, value4: 1268 },
{ category: '2024-05-15', value1: 72, value2: 31, value3: 85, value4: 1076 },
{ category: '2024-06-17', value1: 15, value2: 0, value3: 85, value4: 1055 },
{ category: '2024-07-20', value1: 63, value2: null, value3: 48, value4: 1165 },
{ category: '2024-08-21', value1: 0, value2: 35, value3: 87, value4: 1145 }
]
Currently, only a single number like 1 or 17 appears on the axis, which is incorrect and misleading. How can I ensure that the exact dates from my dataset are displayed on the axis?
And if I keep this property, an error occurs:
Uncaught TypeError: Cannot read properties of undefined (reading 'level')
at leveledFormat (echarts.js?v=e1b83090:15415:24)
at TimeScale2.getFormattedLabel (echarts.js?v=e1b83090:28354:14)
<img width="512" height="732" alt="Image" src="https://github.com/user-attachments/assets/d15d5d32-58d8-40fc-82dd-e5dc90063380" />
### Current Behavior
-
### Expected Behavior
Is there any way to fix this so that I can still display the exact date values that come from my dataset on the time-type axis?
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
_No response_
--
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
Re: [I] [Bug] [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #21343:
URL: https://github.com/apache/echarts/issues/21343#issuecomment-3497188681
I'm sorry to close this issue for it lacks the necessary title. Please provide **a _descriptive_ and as _concise_ as possible title to describe your problems or requests** and then the maintainers or I will reopen this issue.
Every good bug report or feature request starts with a title. Your issue title is a critical element as it's the first thing maintainers see.
A good issue title makes it easier for maintainers to understand what the issue is, easily locate it, and know what steps they'll need to take to fix it.
Moreover, it's better to include keywords, as this makes it easier to find the issue self and similar issues in searches.
--
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
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
Re: [I] [Bug] Incorrect display of dates on the time axis [echarts]
Posted by "qisuwan (via GitHub)" <gi...@apache.org>.
qisuwan commented on issue #21343:
URL: https://github.com/apache/echarts/issues/21343#issuecomment-3882685282
I also encountered this problem, the console reported an error
`time.js:266 Uncaught TypeError: Cannot read properties of undefined (reading 'level')
at leveledFormat (time.js:266:24)
at TimeScale.getFormattedLabel (Time.js:100:25)
at axisHelper.js:219:25
at axisTickLabelBuilder.js:90:27
at Array.map (<anonymous>)
at Module.map (util.js:228:20)
at createAxisLabels (axisTickLabelBuilder.js:85:15)
at Axis.getViewLabels (Axis.js:184:28)
at buildAxisLabel (AxisBuilder.js:851:21)
at layOutAxisTickLabel (AxisBuilder.js:596:5)`
The initial reason was found in axisTickLabelBuilder.js where the tick is undefined for the time attribute
`labels: zrUtil.map(ticks, function (numval) {
var tick = {
value: numval
};
return {
formattedLabel: labelFormatter_1(tick),
rawLabel: axis.scale.getLabel(tick),
tickValue: numval,
time: undefined,
"break": undefined
};
})`
--
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
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
Re: [I] [Bug] Incorrect display of dates on the time axis [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #21343:
URL: https://github.com/apache/echarts/issues/21343#issuecomment-3712017552
I can confirm the _undefined 'level'_ bug, most probably on this line:
https://github.com/apache/echarts/blob/09198192bbb1e274beb408c650c515f8e3a057a5/src/util/time.ts#L346
The bug comes from the _formatter_, not from _customValues_.
Use String Templates in _formatter_ as workaround - [Demo](https://echarts.apache.org/examples/en/editor.html?code=hVZtb9s2EP7uX8FhG5RgrSzKtuLY64bNwZoCMzosW4I1CFbaoi0ilGhIVBzF8H_vHal3p6gDSOJzdw_vjnfHrFWSaRIyzcg7cj8g5N7xPX_y1vPfetR5QygNHt504SnC_mUPphOER5Me7I8BnnY5Rpb6YtRDqYe6XQZAg1PdMVADGkx7qI9OXPoPg4f5oIwsg7gwPDdmu7OQvPuFhPfew_l8oHZaqASkB6DQSkktdjOzgGUqtluezojDnkXm4CaE4OdfSiQaBVYPNIsdB7UsYqHaOwY8wvOIJttUhJWm5BsNeqMfSzLYIEJgXAErpbWKAZlUCASgmUj-ZCsuZ-BSzivi59_AlZk5LtL3RIuYlwSE7FQmMErALX8tSVjM3zMI2B-3ob-VZhpovArEoP8R68cmYsCk2CZ3Qkct1yp9jDTZ6ggoSsR4XFGVFg1XFql9nyESIf_4xFOJ_nVF6zyDKG6ZzDkmwHXdMDM1YH8iycB2RjZMZi2rmKVbAUmoQ4X89wMlZAP5vtGFxCwmKo2ZrLNlhXe8PLRXpTfiBSxpi3AvQkzERQtqWQCFxlJyDmF4dA_L5fIIxUuGQ_dQwM8sYEX2Kn3MarsVC_9vbMkmT9Z4wGdPmJLzVmJN_djW5lDkCd-TK_gsFecnejGEENle4e6W6yWuz87JT4SeKoesaKka3lcoC87SltofuZT_AVSpnuhXcYVmb7C0Pv0MSSW_EsdzwBkLzez7dMua4qr0sOiaIzDD54kLKdd5mpDPPxzaHEe3tTZuIYKBHT_PjR2ckCP5E5cO-f3f9-S7mrKue5wH9mkqtbDNezDyjKfCVHKnlbETocyuRMrXui6zssFXLK2h4RBWd7bMnADGZ4kDumTPrwhw
EmL8mnWdQuSTwvnT9eS0PauBJ6HRGkcUhJFga0Tw9YKDq2mPVZpn0Q2XEEuvMzdCQhUvFbasw-OdLmqjqOy1umWr-TipAHQNKo_dmNHbYzZCDuMThk1HELEklPwDVMusPilnxyBPw-GSXpLglk4X8PY99yKgY0ID-_ZHxDyvg8XI9UfTydRAjR6h09tgQUklrd6UBIReU--ajhcVGShfNgqw6afWya0ft6nKk3ChpMIb6PvNCP8aDZVC5r8mhZTKtnQz3lC4KktprJ74tcmAnVb1ZLJpKadfM0T6e3XZsOlqCf5aErVja6ELGIgNZtnKqvRb877lER33rw2oi4hlpmX6Fn13v-1wyzHPnTa92m1Vq9-7WO3dUnOZO_hDEvLnVhpfoIU-JkuVZ_wu4njTdYoP01-Kl_D5delrxp1msYvmnk9hAiX6im9YLmF01xuU_zWUnT44zr8A&enc=deflate)
<img width="760" height="288" alt="Image" src="https://github.com/user-attachments/assets/f110fe2e-7cff-4bc1-94f2-8b65b0131020" />
--
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
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
Re: [I] [Bug] Incorrect display of dates on the time axis [echarts]
Posted by "MariaChudo (via GitHub)" <gi...@apache.org>.
MariaChudo commented on issue #21343:
URL: https://github.com/apache/echarts/issues/21343#issuecomment-3501967594
Hello.
Yes, it seems so, but for some reason certain dates shift and don't align properly under the correct column—for example, it should show 10.03, but instead displays 8.03. Unfortunately, when working with Zoom, there are also far too many irrelevant dates.
<img width="919" height="372" alt="Image" src="https://github.com/user-attachments/assets/c8bc3c23-8c86-403f-aea5-23dd7fa26a59" />
--
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
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
Re: [I] [Bug] [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] closed issue #21343: [Bug]
URL: https://github.com/apache/echarts/issues/21343
--
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
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
Re: [I] [Bug] Incorrect display of dates on the time axis [echarts]
Posted by "mustcanbedo (via GitHub)" <gi...@apache.org>.
mustcanbedo commented on issue #21343:
URL: https://github.com/apache/echarts/issues/21343#issuecomment-3501431923
<img width="1481" height="771" alt="Image" src="https://github.com/user-attachments/assets/6b70cee4-c850-43a2-8fc7-7c5b0f2a61c5" />Hello, may I ask if what you're saying is displayed like the image above?
--
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
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