• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCHART producing a blank screen

Enthusiast ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

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?

Views

302

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2023 Nov 27, 2023

Copy link to clipboard

Copied

Did you perhaps forget about the cfchart attribute

 query="someQuery"

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 28, 2023 Nov 28, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2023 Nov 28, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2023 Nov 29, 2023

Copy link to clipboard

Copied

To illustrate I shall use a query that I have derived from your previous thread . Run the following code and you will see that the query attribute is necessary:

 

<cfset getClick = queryNew("click_country,totalclicks", "varchar,integer")>
<cfset queryAddRow(getClick, {"click_country"="us","totalclicks"=1})>
<cfset queryAddRow(getClick, {"click_country"="fr","totalclicks"=3})>
<cfset queryAddRow(getClick, {"click_country"="se","totalclicks"=4})>
<cfset queryAddRow(getClick, {"click_country"="de","totalclicks"=4})>
<cfset queryAddRow(getClick, {"click_country"="uk","totalclicks"=8})>

<h1> With <span style="color:purple">query</span> attribute: chart bars are displayed</h1>
<cfchart query="getClick"
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>

<h1> Without <span style="color:purple">query</span> attribute: chart bars are not displayed</h1>
<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>

 

The result is:

BKBK_0-1701249322626.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

Hi @BKBK 

 

I tried the code on my server, no graph

https://www.aspirenet.com/chart.cfm

 

It works locally.

 

It charting something that has to be part of the install that perhaps I omitted when installing CF some years ago?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

No, charting is not an optional feature in the CF installer. It's also not one of the features listed during the install that can be turned off (like cfreport support and some other things can be).

 

While you're in CF2016, I'll say for the sake of completeness that charting is indeed true that in CF2021 and above, it's one of the 50+ "packages/modules" that one can add or remove--and the traditional full installer installs them all. You can look at the CF Admin and its "package manager" page, to see both all modules installed and not installed--if you want to confirm that. You could add it there. But if that was a problem, one would be getting an error rather than a blank page.

 

I'll offer other thoughts in a separate message, not as a reply to this discussion of needing a query (which never quite made sense to suggest, since you showed your original code to be working without one).


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2023 Dec 01, 2023

Copy link to clipboard

Copied

Hi @ACS LLC , in that case, we then have to look into what @Momna33907036fj9n  said. For example, does your production server run on ColdFusion Standard? If so, then that might be the explanation. The Developer Edition is practically ColdFusion Enterprise.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 28, 2023 Nov 28, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2024 Apr 28, 2024

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 01, 2024 May 01, 2024

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 01, 2024 May 01, 2024

Copy link to clipboard

Copied

LATEST

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation