Skip to main content
Inspiring
November 27, 2023
Question

CFCHART producing a blank screen

  • November 27, 2023
  • 3 replies
  • 2034 views

I am displaying a chart using CFCHART. It works fine in local development on CF2016 Developer edition, however when I run the code on the server (also CF2016) I just get a blank white screen.

 

Looking at the source code, everything appears to be there

 

I looked at the CF Administrator and the "Charting" settings are the same. I don't see anything else that is related to the charts.

 

I stripped it back to a very basic call for a chart with no data which will display an empty graph, this works on the local side (see attached screenshot), but not on the server, again, a white screen, no graph. 

 

Code below.

<CFCHART
title="My Graph"
format="html"
show3d="no"
showlegend="yes"
chartheight="400"
chartwidth="500"
labelFormat = "number"
showborder="true"
pieSliceStyle="sliced"
sortXAxis = "yes">

<cfchartseries type="bar" dataLabelStyle="pattern" seriescolor="4199d1" valuecolumn="totalclicks" itemcolumn="click_country">
</cfchartseries>

</cfchart>

 

It's not throwing and error, the source looks okay, and I don't see any errors in the log either.

 

Anybody have any ideas?

    This topic has been closed for replies.

    3 replies

    Charlie Arehart
    Community Expert
    Community Expert
    November 30, 2023

    Bummer to see you've still not gotten resolution to this. I have some thoughts to consider.

    You mention the "source looks okay", but it's unclear: do you mean the CFML source code? or do you mean you did a vew>source on the resulting page which should be rendering the chart? It would be useful for you to compare both that of the page from the server where it works and the page from the server where it does not. Is there any difference? It may be a subtle one (or perhaps an obvious, once you look).

    One may wonder "how could identical CFML code create different results", but as momna noted, there may be some environmental difference in your machines. I have a few possibilities:

    1. What are the specific levels of CF2016 update on each server?

    2. Does the non-working one have debugging enabled (in the admin), perhaps? Even if both do, might the ip address list on one including your IP while the other does not? 

    3. If you create a test cf page in the same folder where this charting page is, and have it produce nothing, do you find the  browser's view>source of the resulting HTML to truly be "nothing" in both cases?

    4. Create a new test folder in that same folder, and put the simple test charting code in a new page there. then add a new empty application.cfm in that new folder. Now request the chart page. Does it appear? If so, something in your application.cfc/.cfm affecting the code in the original folder was causing your issue. It's ABSOLUTELY worth your checking this. don't presume it "won't make a difference". It should take less than a minute to confirm.

    5. If that's STILL note the issue, are you requesting the URL via a web server in each case? Is the web server connector updated in each? Maybe on one it's more updated than the other. I'd not EXPECT that to matter, but it could. Look also at the config files for the connector (in coldfusion2016/config/wsconfig and the numbered folder/s under that). Are they identical in each of the working and not working machines?

     

    Those are a few ideas off the top of my head.

    /Charlie (troubleshooter, carehart. org)
    Charlie Arehart
    Community Expert
    Community Expert
    April 29, 2024

    ACS, did you ever resolve things? I hoped that something I shared above may have helped you.

     

    Indeed, I happened to notice that the demo page you offered produces no result because there are javascript errors. If you use your browser dev tools feature, you'll see that all the requests made back to the server for files with the cf_scripts directory (code which CF generates for you in HTML) all fail with a 404.

     

    If that was the problem back then when you first wrote here, then the reason things didn't work on this server (compared to your local machine) is that someone had removed the cf_scripts virtual directory that would have been put in place by the CF web server configuration tool (wsconfig), creating a connection between your web server (IIS or Apache) and CF.

     

    If you add that back (to this site serving your aspirenet.com domain), pointing at the [coldfusion]\cfusion\wwwroot\cf_scripts folder, you should then find that the charts render. Or you may see some new error (in the dev tools, at its "console" feature) which you could use (along with its "network" feature) to identify whatever may remain as such an error (in the call from the browser to the server).

     

    Hop you'll let us know how things turn out.

    /Charlie (troubleshooter, carehart. org)
    Charlie Arehart
    Community Expert
    Community Expert
    May 1, 2024

    Hi @Charlie Arehart As I moved the new platform to a server with Lucee I found that I didn't have to resolve the issue in ACF as it worked right out of the box with Lucee.


    Well sure, things can differ between the two, for better or worse. I hope what I shared may serve others then, as a simple solution.

     

    We all simply overlooked the misconfiguration back then. It can happen with any product, of course--even lucee. 🙂 

    /Charlie (troubleshooter, carehart. org)
    Participant
    November 28, 2023

    The CFCHART code you've provided appears to be syntactically correct for generating a basic bar chart in ColdFusion. The issue you're experiencing with the chart not displaying on the server, despite working locally, is likely not due to a problem in this code snippet itself. Instead, it might be related to environmental differences between your local setup and the server, such as configuration settings, resource access, or browser compatibility issues. It's important to investigate these areas to identify the root cause of the issue.

    BKBK
    Community Expert
    Community Expert
    November 27, 2023

    Did you perhaps forget about the cfchart attribute

     query="someQuery"

     

    ACS LLCAuthor
    Inspiring
    November 28, 2023

    No, I do have it running with a query, just for the example in this thread I slimmed it down. The code I posted is enough for me to see something is not working, on my local side I get an empty graph, on the server, the blank screen.

    BKBK
    Community Expert
    Community Expert
    November 28, 2023
    quote...  just for the example in this thread I slimmed it down.

    By @ACS LLC

    You shouldn't have. Add the query attribute, and my bet is, it will then work as expected.