ECharts graphic display failed #14033

Closed
opened 2026-02-21 19:15:11 -05:00 by yindo · 2 comments
Owner

Originally created by @iridescentpeo on GitHub (May 20, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

main

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The same echart graphic code, I can directly display graphics using direct reply, but when I use LLM streaming output, it prompts an error.

Image Image

echarts code:

{"title": {"text": "video play","subtext": "Unit: 10000"},"tooltip": {"trigger": "axis"},"legend": {"data": ["Play count","Play duration"]},"xAxis": {"type": "category","data": ["video1","video2","video3","video4"]},"yAxis": {"type": "value"},"series": [{"name": "Play count","type": "line","data": [88888,77777,66666,55555]},{"name": "Play duration","type": "line","data": [99999,88888,77777,66666]}]}

LLM prompt:

Image

Why did this situation occur?

Thanks!

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @iridescentpeo on GitHub (May 20, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version main ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The same echart graphic code, I can directly display graphics using direct reply, but when I use LLM streaming output, it prompts an error. <img width="1118" alt="Image" src="https://github.com/user-attachments/assets/b2d25ff3-77e5-4955-a347-eca389a0d902" /> <img width="1049" alt="Image" src="https://github.com/user-attachments/assets/30be21a6-ac16-447c-b8df-53327324aa4e" /> echarts code: ````echarts {"title": {"text": "video play","subtext": "Unit: 10000"},"tooltip": {"trigger": "axis"},"legend": {"data": ["Play count","Play duration"]},"xAxis": {"type": "category","data": ["video1","video2","video3","video4"]},"yAxis": {"type": "value"},"series": [{"name": "Play count","type": "line","data": [88888,77777,66666,55555]},{"name": "Play duration","type": "line","data": [99999,88888,77777,66666]}]} ```` LLM prompt: <img width="1119" alt="Image" src="https://github.com/user-attachments/assets/43f734b2-772a-4036-ad28-6c889d66b84a" /> Why did this situation occur? Thanks! ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:15:11 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 20, 2025):

Hello @iridescentpeo! I'm Dosu, your friendly bot here to help you with bugs, answer your questions, and guide you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle your issue together!

To resolve the issue of ECharts graphic display failure when using LLM streaming output, ensure that the JSON data used for rendering the charts is properly formatted. This includes having all keys and string values wrapped in double quotes, as improper formatting can lead to errors such as the 'wrong json error'. Streaming output cannot bypass this requirement, so it is crucial to provide complete and correctly formatted JSON data for the charts to render correctly. Additionally, refine your prompt to prevent unnecessary tool calls by the Agent, guiding it to render the visualizations directly rather than attempting to use tools [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 20, 2025): <!-- Greeting --> Hello @iridescentpeo! I'm [Dosu](https://dosu.dev), your friendly bot here to help you with bugs, answer your questions, and guide you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle your issue together! <!-- Answer --> To resolve the issue of ECharts graphic display failure when using LLM streaming output, ensure that the JSON data used for rendering the charts is properly formatted. This includes having all keys and string values wrapped in double quotes, as improper formatting can lead to errors such as the 'wrong json error'. Streaming output cannot bypass this requirement, so it is crucial to provide complete and correctly formatted JSON data for the charts to render correctly. Additionally, refine your prompt to prevent unnecessary tool calls by the Agent, guiding it to render the visualizations directly rather than attempting to use tools <sup>[[1]](https://github.com/langgenius/dify/issues/13575)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/19681)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a58050fb-73e4-4878-932e-5d07e7c99148?feedback_type=other)</sup>
Author
Owner

@LeeeeeeM commented on GitHub (May 20, 2025):

https://echarts.apache.org/examples/zh/editor.html?c=line-simple

have a try

@LeeeeeeM commented on GitHub (May 20, 2025): https://echarts.apache.org/examples/zh/editor.html?c=line-simple have a try
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14033