Are there issues with CFCHART in Lucee? Do I have to install a separate component?
When I try to execute a CFCHART I get an error →
“ERROR”,“ajp-nio-0:0:0:0:0:0:0:1-8009-exec-5”,“03/05/2024”,“12:04:06”,“”,"failure in C:\ACS\showtheoffer\control\reports\geo_displayreport.cfm;undefined tag [cfchart];lucee.runtime.exp.TemplateException: failure in C:\ACS\showtheoffer\reports\geo_displayreport.cfm;undefined tag [cfchart]
Thanks @kenricashe I now have it installed Being a newbie to Lucee I actually forgot about the option to go to EXTENSIONS.
I do have an odd issue though, I’m logged into the dashboard, go to EXTENSIONS - APPLICATION, all good to hear, type CHART and hit FILTER and it kicks me out, saying “No access, password is invalid”. Log back in and there is CHART when I go back to EXTENSIONS. Go to install it, kicks me out again, log back in, it’s installed.
Would you know where I might report this as a bug?
Just noting that many cfml devs have moved from native cfchart to purely frontend Javascript chart rendering alternatives, such as https://www.chartjs.org/. These are powerfull and often more flexible than cfchart.
I set up the CFchart extension back in March and it worked well. I don’t remember having any installation/config issues. However I just came to run the code which I’ve not used since then and found that it is not working.
The graphs are just broken images
If I open the link for the images I get
401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.
This was a staging set up which I had just added SSL, and therefore it was now https so I removed the web.config (IIS10) to redirect to SSL and re-ran it on HTTP as it was before, and it still has the same issue.
I uninstalled the extension and reinstalled it, that didn’t help.
I do notice in my root that there is a folder called LUCEE, however there is no graph.cfm in there. It is possible that there was a file and when I copied all my files from my local side I cleaned it out and lost it. I’ve not created a graph.cfm so presume Lucee makes that, but the uninstall/reinstall did not fix it.
I know chartjs was mentioned previously when I initially set up CFChart.
I’ve only got two charts in an internal dashboard. I don’t normally need charts so I’m a little reluctant to try and convert to another solution, especially since it was working
Try opening to view the chart from localhost, bypassing any firewall or webserver permission setting. Some lucee directories may be blocked by security settings that you have setup on your webserver.
If that doesn’t work, setting up a 3 charts with chart.js is as easy as here:
I created a drop of code to place a basic chart and ran it locally in C:\lucee\tomcat\webapps\ROOT using http://localhost:8888/graph.cfm and the graph appears
I then used the same code in the root of my domain, and it fails to display an image.
I decided to look at switching to chart.js. My initial attempt was a bit of a fail. I am not sure why but if I put a test chart at the top of the page with baked in data it displays, but as I move it down the page to the right place so I can populate with actual data from the query, keeping it the same with the baked in data, no graph appears.
Edit: I believe I found the issue above, I had a <b> that was not closed, and putting the code under that caused it to fail to display anything. I just need to figure out how to display more than one graph on the same page as below
Also I then tried to display two graphs, I figured I just give them unique ID’s but only the first one shows.
Edit: I realized I should be using xValues2 and yValues2 across the 2nd one.
It’s very cool, but I have to admit to get it to do a few fancy things like add the count of each record and the percentage of the total value in each mouse over of the pie chart, I had to use chatGPT.
Unfortunately it did give me a link to the CDN for an older version, then updated the code and gave me the new version but there were in compatibilities, all fixed now.
Although I don’t need any help now, I thought I would leave the post here for others