tracker issue : CF-3815366

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

cfchart type=PNG doesn't load background-image

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Alan Bullpitt / Alan Bullpitt (Alan Bullpitt)

Created: 08/29/2014

Components: Charting/Graphing

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 1

Problem Description: Trying to add a background image to the cfchart format=png doesn't work. Same code works for format=HTML or format=FLASH

Steps to Reproduce: Create cfchart with background image set. Set format to PNG. Example provided

Actual Result: Background Image isn't loaded. Same chart set to either HTML or FLASH displays background image. 

Expected Result:Expected output to look the same as HTML and FLASH version. 

Any Workarounds:

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

Watson Bug ID:	3815366

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





Server Details

Server Product	ColdFusion

Version	11,0,0,289822

Edition	Enterprise (Trial) 

Operating System	Windows 7 

OS Version	6.1 

Adobe Driver Version	5.1.1 (Build 0001) 





JVM Details

Java Version	1.7.0_51 

Java Vendor	Oracle Corporation 

Java Vendor URL	http://java.oracle.com/ 

Java Home	C:\ColdFusion11\jre 

Java File Encoding	Cp1252 

Java Default Locale	en_US 

File Separator	\ 

Path Separator	; 

Line Separator	Chr(13) 

User Name	WS-T3500-02$ 

User Home	C:\ 

User Dir	C:\ColdFusion11\cfusion\bin 

Java VM Specification Version	1.7 

Java VM Specification Vendor	Oracle Corporation 

Java VM Specification Name	Java Virtual Machine Specification 

Java VM Version	24.51-b03 

Java VM Vendor	Oracle Corporation 

Java VM Name	Java HotSpot(TM) 64-Bit Server VM 

Java Specification Version	1.7 

Java Specification Vendor	Oracle Corporation 

Java Specification Name	Java Platform API Specification 

Java Class Version	51.0

Attachments:

  1. August 30, 2014 00:00:00: 1_graph.cfm
  2. August 30, 2014 00:00:00: 2_test.txt
  3. August 30, 2014 00:00:00: 3_line-graph-blue-white.png
  4. September 02, 2014 00:00:00: 4_test2.txt
  5. September 03, 2014 00:00:00: 5_linegraph.PNG
  6. December 03, 2014 00:00:00: 6_3815366.zip
  7. December 07, 2014 00:00:00: 7_myimage.png

Comments:

For PNG chart the image location should be an absolute path like C:/dev/line-graph-blue-white.png Alternatively a URL will work for both server and client side charts.
Comment by Himavanth R.
11197 | September 02, 2014 05:58:14 AM GMT
Using an absolute path like C:/dev/line-graph-blue-white.png throws an error and using the alternative URL did not work. Side note documentation for cfcharts is horrible and out of date.
Comment by External U.
11198 | September 02, 2014 10:35:58 AM GMT
When cfchart format is png, absolute path of the image should be specified and when format = html or flash image path should be relative. I am using the test2.txt(specifying URL for the image) as style attribute in graph.cfm and cfchart format="png" renders the background image. Using the Coldfusion build - 289822 Enterprise version, Java version -1.7.0_51 , OS - Windows 7 (Comment added from ex-user id:nawani)
Comment by Adobe D.
11199 | September 03, 2014 02:19:56 AM GMT
Thanks for the feedback. Turns out I had to reinstall Coldfusion 11 again to get this to work correctly. I have attached a screenshot of my results before re-installing CF incase this affects anyone else.
Comment by External U.
11200 | September 03, 2014 10:36:32 AM GMT
Hi Himavanth and Anuj, For me, absolute path and URL are not working for format="png". Repro: In background attribute, try changing directoryURL to directoryPath and it still does not render the background. For format="html" and format="flash", directoryURL works. What should I do for format="png"? <cfscript> myPNG = imageNew("", 400, 400, "rgb", "blue"); imageWrite(myPNG, expandPath("./myimage.png"), 1, true); directoryURL = (CGI.HTTPS is "off"?"http":"https") & '://' & CGI.SERVER_NAME & getDirectoryFromPath(CGI.SCRIPT_NAME) & '/'; directoryPath = getDirectoryFromPath(expandPath("./")) & '\'; </cfscript> <cfchart format="png" width="400" height="400" background='#{"image":"#directoryURL#myimage.png"}#'> <cfchartseries type="pie"> <cfchartdata item="New car sales" value="50000"> <cfchartdata item="Used car sales" value="25000"> <cfchartdata item="Leasing" value="30000"> <cfchartdata item="Service" value="40000"> </cfchartseries> </cfchart> Also, format="png" should also allow background='#{"image":"myimage.png"}#' b/c CF can use CGI vars to build the full URL. Thanks!, -Aaron
Comment by External U.
11201 | November 24, 2014 01:41:51 AM GMT
This issue still exists in CF11 Update 3 (11,0,03,292480). For repro, please unzip attached CF-3815366.zip and run it. Path Types (referenced in summary below): 1) (File) background='#{"image":"myimage.png"}#' 2) (Absolute) background='#{"image":"c:\path\to\myimage.png"}#' 3) (URL) background='#{"image":"http://www.foo.com/path/to/myimage.png"}#' Developer Edition does this: - type="png", doesn't render myimage.png background for any path type. - type="html", renders myimage.png background only if path type is #1 (File) or #3 (URL). - type="flash", renders myimage.png background only if path type is #3 (URL). Enterprise Edition does this: - type="png", renders myimage.png background only if path type is #2 (Absolute). - type="html", renders myimage.png background only if path type is #1 (File) or #3 (URL). - type="flash", renders myimage.png background only if path type is #3 (URL). Regardless of edition, format="flash" breaks (doesn't even display chart at all), if path type is #2 (Absolute). Issue: Chart background image should render consistently regardless of edition, chart type, and path type (File, Absolute, URL). If file name is provided, then CF can use expandPath('./') to build the absolute path or use CGI vars to build the URL. And no reason for Developer edition to not render the background image for png, but render it for html and flash. Thanks!, -Aaron
Comment by External U.
11202 | December 03, 2014 12:24:34 AM GMT
+1 - I hope this ticket can be resolved completely (currently isn't)
Vote by External U.
11205 | December 03, 2014 12:25:16 AM GMT
Closing this bug as: for png chart, absolute path or url of the image should be specified and when format = html or flash image path should be relative or a url. For other issues in the note, have logged bug: CF-3863493 and CF-3863490 Developer Edition does this: - type="png", doesn't render myimage.png background for any path type. - Bug # CF-3863493 logged - type="html", renders myimage.png background only if path type is #1 (File) or #3 (URL). - As designed(Same behavior in CF10) - type="flash", renders myimage.png background only if path type is #3 (URL). - This also works when path is type#1 - As designed Enterprise Edition does this: - type="png", renders myimage.png background only if path type is #2 (Absolute).- This works for type3(URL) as well(<cfchart format="png" background=#{"image":"http://localhost:8501/BugsCF11/CF-3815366/whiteFlower.png"}#>) - As designed(Same behaviour in CF10) - type="html", renders myimage.png background only if path type is #1 (File) or #3 (URL). - As designed(Same behaviour in CF10) - type="flash", renders myimage.png background only if path type is #3 (URL) - This works for type#1(File) as well- As designed Regardless of edition, format="flash" breaks (doesn't even display chart at all), if path type is #2 (Absolute). - Logged bug #CF-3863490 (Comment added from ex-user id:nawani)
Comment by Adobe D.
11203 | December 07, 2014 04:06:24 AM GMT
Hi Anuj, Thank you very much for confirming/explaining all that and filing the tickets. I've verified type="html" supports URL path type. My localhost URLs weren't working for some reason, but they are now (that was user-error on my end). I've also verified type="flash" supports relative paths. My repro example for this mistakenly had type="png" (user-error on my end). I've also filed/fixed #CF-3863501 (updated cfchart doc to explain which chart formats support which background image path types). Thanks!, -Aaron
Comment by External U.
11204 | December 07, 2014 07:38:40 AM GMT