The front - end rendering of the chart generated by the Agent using the chart tool has an error. #13951

Closed
opened 2026-02-21 19:14:43 -05:00 by yindo · 3 comments
Owner

Originally created by @azooly on GitHub (May 16, 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

1.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Agent configuration
Image
There is an error in the front - end display, and there are also errors in the debugging and preview interfaces.
Image
Log and annotation interface. Checking the access log shows normal.
Image

✔️ Expected Behavior

In the debugging and preview interface, the rendered charts are displayed normally, and the front - end interface after release can also render charts.

Actual Behavior

No response

Originally created by @azooly on GitHub (May 16, 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 1.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Agent configuration ![Image](https://github.com/user-attachments/assets/f5e6b0a9-e0c4-47db-a578-ebf182c838d6) There is an error in the front - end display, and there are also errors in the debugging and preview interfaces. ![Image](https://github.com/user-attachments/assets/9c39f313-fea2-4312-9f89-bdbc20db6716) Log and annotation interface. Checking the access log shows normal. ![Image](https://github.com/user-attachments/assets/36af4ba6-8b43-49bd-9b74-050de0a11483) ### ✔️ Expected Behavior In the debugging and preview interface, the rendered charts are displayed normally, and the front - end interface after release can also render charts. ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-21 19:14:43 -05:00
Author
Owner

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

To resolve the front-end rendering error of the chart generated by the Agent using the ECharts tool in a self-hosted Docker environment, ensure that the chart data is formatted correctly in JSON. The error may occur if the data is in JavaScript object notation rather than valid JSON format. To fix this, convert your data to proper JSON format by quoting the keys. For example, instead of using {xAxis: {data: ['Mon', 'Tue']}}, use {"xAxis": {"data": ["Mon", "Tue"]}} [1].

Additionally, refine your prompt to prevent unnecessary tool calls by the Agent, ensuring it renders the visualizations directly without attempting to use tools. If you encounter a non-functional image link issue with ECharts, modify your chatflow configuration by using a 'direct reply' node after invoking the ECharts tool. Alternatively, if using parallel processing, reference echarts/text after a line break when replying directly [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 16, 2025): <!-- Answer --> To resolve the front-end rendering error of the chart generated by the Agent using the ECharts tool in a self-hosted Docker environment, ensure that the chart data is formatted correctly in JSON. The error may occur if the data is in JavaScript object notation rather than valid JSON format. To fix this, convert your data to proper JSON format by quoting the keys. For example, instead of using `{xAxis: {data: ['Mon', 'Tue']}}`, use `{"xAxis": {"data": ["Mon", "Tue"]}}` <sup>[[1]](https://github.com/langgenius/dify/issues/13575)</sup>. Additionally, refine your prompt to prevent unnecessary tool calls by the Agent, ensuring it renders the visualizations directly without attempting to use tools. If you encounter a non-functional image link issue with ECharts, modify your chatflow configuration by using a 'direct reply' node after invoking the ECharts tool. Alternatively, if using parallel processing, reference echarts/text after a line break when replying directly <sup>[[2]](https://github.com/langgenius/dify/issues/15163)</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/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/796f0718-6fd7-4458-ad7e-dd42d3d7819b?feedback_type=other)</sup>
Author
Owner

@azooly commented on GitHub (May 16, 2025):

This problem occurred in the Agent mode. The data was checked and there was no problem. The quotation marks and line breaks were all correct. In the interface for viewing historical messages in the Agent's logs, the correctly displayed charts could also be seen. However, the "Preview and Debug" interface and the access link after publication cannot be displayed.

@azooly commented on GitHub (May 16, 2025): This problem occurred in the Agent mode. The data was checked and there was no problem. The quotation marks and line breaks were all correct. In the interface for viewing historical messages in the Agent's logs, the correctly displayed charts could also be seen. However, the "Preview and Debug" interface and the access link after publication cannot be displayed.
Author
Owner

@azooly commented on GitHub (May 18, 2025):

Image
I tested again today and found that as shown in the figure below: when generating a bar chart, the chart did not display properly after execution.
However, after refreshing the entire page by pressing F5, the charts in the historical chat records that were not displayed correctly before are all displayed normally.
Image

@azooly commented on GitHub (May 18, 2025): ![Image](https://github.com/user-attachments/assets/6ab5b150-af00-4c17-a9b2-91b0b32c67be) I tested again today and found that as shown in the figure below: when generating a bar chart, the chart did not display properly after execution. However, after refreshing the entire page by pressing F5, the charts in the historical chat records that were not displayed correctly before are all displayed normally. ![Image](https://github.com/user-attachments/assets/c5bf5cef-5b73-4fea-9201-9cb8a91f73dc)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13951