Hello, I am making a Chart with custom type and it requires you to have a Chart Source so I build one and created a js file. For testing purposes, I created a frappe chart JS script. However, I don’t have an html container for the chart to render. I can’t also find a way in the documentation on how to do it.
My question is, how can you add an html file or html container in the Chart Source?
Tried also the ff:
Used render_template() but Template not found, with this test I created an html inside Chart Source folder. This one’s working on Doctypes I don’t know if it’s just restricted with Chart->Chart Source
DOM(just for testing): I directly inserted an element in frappe template property and used render().
PS: This is purely Frappe and will be Integrated in a Dashboard. Trying Custom Chart because the Chart I’m building is complex so
basic built-in aggregation and Chart->Report source will not suffice. Thank you.
Once you create a report, you can build a chart using purely server side and automatically rendered in the report page including the report table. By adding the chart to a dashboard, it automatically captures what is displayed in the report page for rendering in dashboard page.
I avoid using Page because I already have existing cards so that I don’t have to redo it.
I was able to find a solution with this one, I explored the ERPnext source code which is more likely the same syntax like the Script Report and Page Creation.
Creation Steps:
Head over to Dashboard Chart Source → add Dashboard Chart Source
Fill up the name and module
Note: this will create a folder in your module and manually add JS and Py file named like your folder because it doesn’t populate not like doctype.
3.Head to Dashboard Chart → add Dashboard Chart
4.Fill up the following → chart type:custom → chart source: the one u created(dashboard chart source)
Now for the coding, just add your code in the dashboard chart source JS and Py files. Source Code
Fore more details, please look at the link as I removed the functionality in the server side, only the return is remained.
I hope this helps, especially with the new ones.