I was trying to run my charts in CF11 which I had already created in CF9 but it seems that coldfusion 11 has major changes done in chart engine and Adobe has not considered backward compatibility for charts.
Following is the simple code to generate the chart in CF9 which I have written earlier.
<cfchart style="blue">
<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>
Following is the output I got in CF9-
When I tried to execute the same code in CF11, I am getting error –
Actually right now there is no any short cut available other that building the whole charts again with the attributes provided in the CF11 or need to use zingchart engine to create chart i.e JSON based styles instead of XMLfile based styles.
The reason of the above error is now coldfusion 11 is using JSON file to render chart styles as follows -
<cfchart
format="html"
style = "JSON filename">
</cfchart>
OR
In build attributes will be used to render style of the chart.
<cfchart
alpha = "value between 0 and 1"
arrows = "JSON string representation"
aspect3D = "JSON string representation"
background = "JSON string representation"
bevel = "JSON string representation"
border = "JSON string representation"
backgroundColor = "hexadecimal value|web color"
chartHeight = "integer number of pixels"
chartWidth = "integer number of pixels"
crosshair = "JSON string representation"
dataBackgroundColor = "hexadecimal value|web color"
fill = "JSON string representation"
font = "font name"
fontBold = "yes|no"
fontItalic = "yes|no"
fontSize = "font size"
foregroundColor = "hexadecimal value|web color"
format = "flash|jpg|png|html"
gridlines = "integer number of lines"
height = "height in pixels"
ID = "chart identifier"
labels = "JSON string representation"
legend = "JSON string representation"
labelFormat = "number|currency|percent|date"
marker = "JSON string representation"
markerSize = "integer number of pixels"
name = "string"
pieSliceStyle = "solid|sliced"
plot = "JSON string representation"
plotarea = "JSON string representation"
preview = "JSON string representation"
refresh = "canvas|flash|svg|vml"
renderer = "canvas|flash|svg|vml"
scales = "comma-seperated list of axes"
scaleFrom = "integer minimum value"
scaleTo = "integer maximum value"
seriesPlacement = "default|cluster| stacked|percent"
show3D = "yes|no"
showBorder = "yes|no"
showLegend = "yes|no"
showMarkers = "yes|no"
showXGridlines = "yes|no"
showYGridlines = "yes|no"
sortXAxis = "yes|no"
tipBGColor = "hexadecimal value|web color"
tipStyle = "MouseDown|MouseOver|none"
title = "title of chart"
tooltip = "JSON string representation"
url = "onClick destination page"
xAxis = "JSON string representation"
xAxis2 = "JSON string representation"
xAxisTitle = "title text"
xAxisType = "scale|category"
xAxisValues = "Array of values"
xOffset = "number between -1 and 1"
yAxis = "JSON string representation"
yAxis2 = "JSON string representation"
yAxisTitle = "title text"
yAxisType = "scale|category"
yAxisValues = "Array of values"
yOffset = "number between -1 and 1">
zoom = "JSON string representation"
</cfchart>
I am part of the discussion going on the following adobe community thread but till now there is no solid fix done after few round of hotfix testing.
We are waiting for some hotfix from adobe.
But seems like this fix also will be major change and will come with another release, till that time hold the migration to coldfusion 11 if you have created huge amount of charts.
Update : This issue has been fixed in the Pre-release version 11.02.xxxxx.
Please check my below post for fix -
http://dattatrayshindecoldfusion.blogspot.sg/2014/11/coldfusion-11-cfchart-issue-while-using.html
Update : This issue has been fixed in the Pre-release version 11.02.xxxxx.
Please check my below post for fix -
http://dattatrayshindecoldfusion.blogspot.sg/2014/11/coldfusion-11-cfchart-issue-while-using.html
No comments:
Post a Comment