|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfchart and bar colors
Greeting,Larry Lyons 03/11/10 03:49 P > The cfChartSeries attribute colorlist will allow a seriesLeigh 04/15/10 10:53 P Thanks ofr the suggestion. Ray Camden helped me on this one, and ended up blogging about it. Here's the link to Ray's blog post on it:Larry Lyons 04/16/10 03:23 P > Thanks ofr the suggestion. Ray Camden helped me on thisLeigh 04/16/10 07:03 P --- bump ---Larry Lyons 03/12/10 11:23 A Greeting, I have a cfchart where we display percent responses by department. While cfchartseries will set the colour for all the bars, the powers that be want the color to be different for each bar depending on the response percentage, as in:. 0 - 49 % red 50-74% orange 75%-89% green 90%+ blue The cfChartSeries attribute colorlist will allow a series of colors, but in this case the X axis is ordered by department name rather than by response percentage. So at this point I'm at a bit of a loss on how to do this, so any help would be very much appreciated. thx, larry > The cfChartSeries attribute colorlist will allow a series > of colors, but in this case the X axis is ordered by > department name rather than by response percentage. Just sifting through a ton of old mailing list items .. I am sure you figured this out already. But for the archives, you could calculate the colorlist dynamically. A simple approach is using a CASE statement in your db query to determine the colors for each value. SELECT Department, ResponseValue, CASE WHEN ResponseValue BETWEEN 0 AND 49 THEN 'Red' -- in hex ... WHEN ResponseValue BETWEEN 50 AND 74 THEN 'Orange' ... etc... END AS BarColor ... or store the color range information in a db table and use a JOIN. Thanks ofr the suggestion. Ray Camden helped me on this one, and ended up blogging about it. Here's the link to Ray's blog post on it: http://www.coldfusionjedi.com/index.cfm/2010/3/12/Coloring-CFCHART-Dynamically ----- Excess quoted text cut - see Original Post for more ----- > CASE > WHEN ResponseValue BETWEEN 0 AND 49 THEN 'Red' -- in hex ... > WHEN ResponseValue BETWEEN 50 AND 74 THEN 'Orange' ... > etc... > END AS BarColor > ... > or store the color range information in a db table and use a JOIN. > > > > > Thanks ofr the suggestion. Ray Camden helped me on this > one, and ended up blogging about it. Here's the link to > Ray's blog post on it: You inspired a blog entry, cool! Yes, I can see he was thinking along similar lines. Except he used CF versus SQL + valueList(query.BarColor). Nice follow-up for the archives :) Cheers -Leigh --- bump ---
|
July 31, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||