tracker issue : CF-3959931

select a category, or use search below
(searches all categories and all time range)

HTML CFCharts conflict with prototype.js

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Scott Brady / Scott Brady (Scott Brady)

Created: 03/26/2015

Components: Charting/Graphing

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: ALL / Mac 10.10 64 bit

Vote Count: 3

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on July 30, 2017 using build 2016.0.01.298513
Problem Description:
When using type="HTML" in cfchart and using prototype.js, charts don't render due to a conflict in the automatically rendered "$(document).ready()"

Steps to Reproduce:
1) Create a page that includes the prototype.js library and has a <cfchart> tag with type="HTML"
2) Load the page

Actual Result:
Charts do not display, due to a JS error: TypeError: $(...).ready is not a function

Expected Result:
Charts would display

Any Workarounds:
Put the cfchart output into a variable (using <cfsavecontent>) and replace "$(document)" with "jQuery(document)" on the content before displaying the content.

I'm surprised the idea of there being conflicts with other libraries never came up in testing the new HTML charts.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3959931

External Customer Info:
External Company:  
External Customer Name: Scott
External Customer Email:  
External Test Config: My Hardware and Environment details:



This prevents our customers from seeing their chart data.
Vote by External U.
7972 | March 26, 2015 01:27:36 PM GMT
Yup, there are still situations where prototype is used.
Vote by External U.
7973 | March 26, 2015 01:30:01 PM GMT
this needs to be fixed so we can continue using CFChart in our application.
Vote by External U.
7974 | March 26, 2015 02:39:43 PM GMT
Since Adobe has not updated the ZingChart script since it was introduced and the included scripts are also woefully outdated, it is not a surprise that you are seeing conflicts. Recommend abandoning cfhart and using the full power of ZingCharts ( or other charting library.
Comment by External U.
7969 | March 26, 2015 03:12:59 PM GMT
We're actually evaluating other charting libraries for when we do a more full-featured revamp of the app, but as a stopgap we've been converting cfchart to HTML instead of PNG (which was causing other issues for our users).
Comment by External U.
7970 | March 26, 2015 03:21:03 PM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
7971 | July 30, 2017 09:34:29 PM GMT