Output Chart to Image


/ Published in: ColdFusion
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <cfchart name="statsChart" showborder="yes" format="png"
  2. chartheight="400"
  3. chartwidth="600"
  4. yaxistitle="Unique Users" xaxistitle="Time Period"
  5. >
  6.  
  7. <Cfchartseries type="bar" serieslabel="Store #client.store.id#">
  8. <Cfloop query="qryGetStats">
  9. <cfchartdata item="#dateformat(hitdate, 'mm/dd/yy')#" value="#showTotal#">
  10. </Cfloop>
  11. </Cfchartseries>
  12. </cfchart>
  13.  
  14. <cfset statsChart = imageNew(statsChart)>
  15.  
  16. <cfimage action="writetobrowser" source="#statsChart#" />

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.