镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Bug] Combining customValues with a custom formatter function on a time axis. The internal time formatter expects tick objects with a time property, but customValues creates simpler tick objects without this property. #21226

Closed

Description

@HansDenFlammenwerfer

Version

6.0.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?code=PTAECEFcHMC5QMaQM4BcD2BbAagQwDaQCmyoA7gJaoAWoqFmRouAHhaQriiaAGboAnTLlSoiA0OIGCAUCFABRAdIHwARJwB2AclTMECEqQAO04-NQBPUNvxEAbkXzaANHQoIA1gDp6jUOygkJoAJkS8FJpEIWoyMgjommjkRESe-JYAIiK4oAC8oADaMqBF2gBMAAzlAKwAtJX15QBsrqAAjO3NALouJWVVtQ3NDeVt7eUAnL39hRXV9ZUjlZPjAMw1M6Vzg4sjXW0AHD192_NDS3Xla20A7GtbAwvDdWuVR5unTxe3Dbd3Dy-O2elV-7QALG1modHsCfld2m1JuVYedFr9yocjuDUbsGocGpC3LdpkC0fi6p0jjCyXjKgT2li3JN2riQQTakjNjJugBuOLyBQsVACXAIPR-EioXCYYykfgSJBoLB4QgkeKJZKStAyuX5FJpDLZaXeYTGAAUIXyAD5QFEyKBjURLYVKt0AJTeaBEVAAFQYzvd7v5MnQxnoiX1AG9-tABBQQvAY6VSnZeKh4Np2pUAKSufqlePQagZmzZvNfUoAI3QoiwmfaNQrBboYYbue0_QAvl8WABBNjIJMtqzmTOS_Mp0A14IhXACSwAcVwxngOwrNnKecepVY7AAMrgq05h1PSvIAKrISLQRAoDA4AjEUgYPiCQzuLygYzoa8RpJvhIZCpOk1hztKLalEqD6qs-8DatKsrIJWKaQaA8i-tQgQKsIojiIgXDIDwNBMFIgjkNQRCaEERFWpQNB3sqj5qsgaE4SIYiqHwwTihQiTmvYT5EO6oDJmeUGano4FMAU9qOiIzqCWqwZoRJSR6JgiQMQU0lej6ACyWnUOaIkANQdPy4lqckc7WDpCl6agTomZZVkCD6kACNRAAGAAkUa2aAAA8HSVKAAD8NjvKA5mBfAtldt4_maZoDEhdmEVRdoMWgClDHwHl1Bdt5rlTl2LblaUPb9JYA7sKeKajkQmZKcQnZVV8RHxiQa5iaUTWZlW86Tim4G4PAwGGlkOTdt0MhdiGgosOY4rRNORDULg9h8Vx0EqkJpDINQ6CQPgdGCJ45BULQ7F4RICruP4e6sfIfbipABDrZt22CPASgqKAdSgBouA6HoYqGMgJhmBY1i2A4ThtPQXi-AGASkLO4SRNEsTyHIYCYUw7DIMQoDoAYnmkMenDcBRVGMTBB3ozRa30bQuSSswg59PIJGfpd6BVgAVkQ4ocO5ClWiEiS6KA31MHzugBtlphhrDdCbRKlGgPjoD-owADKnB2IBuGcZIy2i6gyEESgN6gN6qAAGKCGb0SHse-CtnwuAUPg3hAA

Steps to Reproduce

  1. Use echarts 6.0.0
  2. Use CostumValues and a formatter in axisLabel: of xAxis.
  3. Get an error message instead of a rendert chart

Current Behavior

With Echarts 6.0.0 CostumValues and a formatter on xAxis.axisLabel: does not work.
But it did with Echarts 5.6.x

Expected Behavior

Expect to render the chart with costum labels and ticks.

Environment

- OS: Windows 11 / MacOS
- Browser: Edge / Firefox / Crome
- Framework:  React 18

Any additional comments?

No response

Activity

  1. added
    enThis issue is in English
    pendingWe are not sure about whether this is a bug/new feature.
    on Aug 26, 2025
  2. changed the title [-][Bug] Combining customValues with a custom formatter function on a time axis. The internal time formatter expects tick objects with a time property, but customValues creates simpler tick objects without this property.[/-] [+][Bug] Combining customValues with a custom formatter function on a time axis. The internal time formatter expects tick objects with a time property, but customValues creates simpler tick objects without this property.[/+] on Aug 26, 2025
  3. helgasoft commented on Aug 27, 2025

    @helgasoft

    yes, works in 5, but not in 6.

  4. jorinvo commented on Nov 9, 2025

    @jorinvo

    Hi, any updates on this?
    Is there any workaround or some way we can help fix it?
    I ran into the same issue and it's stopping me from upgrading to version 6.
    Thanks 🙂

  5. helgasoft commented on Nov 10, 2025

    @helgasoft

    OP has written in Min. Repro:
    Expected behavior: customValues should work with formatter for time axis
    Actual behavior: Error - "can't access property 'level', tick.time is undefined"

    The issue occurs because when customValues is used with a time axis, the tick objects created don't have the 'time' property that the TimeScale formatter expects, causing getFormattedLabel to fail.

    Most probably bug pops on this line in v.6 :

    level: tick.time.level,

    The corresponding line in v.5 is this one:
    level: tick.level

    Indeed, looks like function leveledFormat has been rewritten in v.6 and new tick.time is not properly set.

    Who could help? According to recent activity, maybe @Srajan-Sanjay-Saxena...?

  6. Srajan-Sanjay-Saxena commented on Nov 10, 2025

    @Srajan-Sanjay-Saxena
    Contributor

    OP has written in Min. Repro: Expected behavior: customValues should work with formatter for time axis Actual behavior: Error - "can't access property 'level', tick.time is undefined"

    The issue occurs because when customValues is used with a time axis, the tick objects created don't have the 'time' property that the TimeScale formatter expects, causing getFormattedLabel to fail.

    Most probably bug pops on this line in v.6 :

    echarts/src/util/time.ts

    Line 346 in 6f305b4

    level: tick.time.level,

    The corresponding line in v.5 is this one:
    echarts/src/util/time.ts

    Line 177 in fe42bc1

    level: tick.level

    Indeed, looks like function leveledFormat has been rewritten in v.6 and new tick.time is not properly set.
    Who could help? According to recent activity, maybe @Srajan-Sanjay-Saxena...?

    Sure i will help to resolve the issue

  7. Srajan-Sanjay-Saxena commented on Nov 10, 2025

    @Srajan-Sanjay-Saxena
    Contributor

    @helgasoft solved the issue in pr #21352

  8. jorinvo commented on Nov 11, 2025

    @jorinvo

    Wow that was fast 🚀 Thank you both!

  9. added this to the 6.0.1 milestone on Nov 12, 2025
  10. added
    regressionSomething no longer works as expected since a certain version
    and removed
    pendingWe are not sure about whether this is a bug/new feature.
    on Nov 12, 2025
  11. removed this from the 6.0.1 milestone on Nov 12, 2025
  12. HansDenFlammenwerfer commented on Nov 14, 2025

    @HansDenFlammenwerfer
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishregressionSomething no longer works as expected since a certain versiontopic: axis-time

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions