Added Bullet Graphs to SparcklineCFC
Posted by Fred Anderson on January 22nd, 2009It's been a while since I have posted any work on the SparklineCFC project. I have received some help from a co-worker, Chris Irwin. He has reorganized the the code to be more inline with traditional OO practices.
I have added Bullet graphs to sparkline Options. Here is an example.

You the basic concept for calling the Bullet Graph is the same as the other Sparkline objects. Set up the Sparkline Object with some of the basic settings.
<cfscript> sBulletGraph = structNew(); sBulletGraph.type = "BulletGraph"; sBulletGraph.width = 200; sBulletGraph.qualitativeRanges = "80,120,200"; sBulletGraph.qualitativeColors = "996633,CC9966,FFCC99"; sBulletGraph.foregroundColors = "000000,808080"; sBulletGraph.backgroundColor = "00FF00"; BulletGraph = createobject("component","Sparkline").init(argumentCollection = sBulletGraph); </cfscript>Next, calling the graph is as simple as creating an argument collection and passing it into the draw function the object we have just created.
<cfset dot = false> <cfset qColors = "DD747A,EAABAF,AFD7B9,7ABC8A"> <cfset qRanges = "70,100,130,200"> <cfset args = {data=data, referencePoints=referencePoints, performanceDot=dot, qualitativeColors = qColors, qualitativeRanges = qRanges}> #BulletGraph.draw(argumentcollection=args)#In a case like this you can loop over this section pass a different data value in as you go.