• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

same item column(s) different valuecolumns

New Here ,
Jan 26, 2007 Jan 26, 2007

Copy link to clipboard

Copied

When trying to output a chart with the same itemcolumn values, but different valuecolumn values cfchart only graphs the second one. I would expect to get two slices of apples, one equaling 10, the other 15, but I only get the 15. I'd even settle for 25 apples!

apples - 10
apples - 15
oranges - 20

<cfscript>
level = queryNew('howmany,name');
queryAddRow(level);
querySetCell(level, 'howmany','10');
querySetCell(level, 'name','Apples');

queryAddRow(level);
querySetCell(level, 'howmany','15');
querySetCell(level, 'name','Apples');

queryAddRow(level);
querySetCell(level, 'howmany','20');
querySetCell(level, 'name','Oranges');
</cfscript>

<cfdump var="#level#">

<cfchart show3d="true" format="flash" chartwidth="800" chartheight="550">
<cfchartseries type="pie"
query="level"
itemcolumn="name"
valuecolumn="howmany">
</cfchartseries>
</cfchart>



<cfchart show3d="true" format="flash" chartheight="500" chartwidth="500">
<cfchartseries type="bar"
query="level"
itemcolumn="name"
valuecolumn="howmany">
</cfchartseries>
</cfchart>

how do you like them apples? I don't like them apples!
TOPICS
Advanced techniques

Views

398

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2007 Jan 26, 2007

Copy link to clipboard

Copied

Make the names distinct. Change the lines querySetCell(level, 'name','Apples'); and querySetCell(level, 'name','Apples'); , respectively, to querySetCell(level, 'name','Apples_1'); and querySetCell(level, 'name','Apples_2');.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 27, 2007 Jan 27, 2007

Copy link to clipboard

Copied

Yeah, that would fix it, the problem is this for dynamic reports where users enter what they wish in the name field, and sometimes want to have the same name twice. I don't want to munge through the return set and add random bits to names that are the same for a variety of reasons.
A: Performance (some of these result sets are huge)
B: The end users would complain anyway
C: I shouldn't have to, I should get three slices.

I think this is a bug in cfchart. When i graph a similiar recordset in Excel, it shows three slices. ChartFx also shows three slices.

ColdFusion and Flex both show two slices. Ironically, CF always displays the last value in the recordset, Flex displays the highest value regardless of position..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 27, 2007 Jan 27, 2007

Copy link to clipboard

Copied

This absolutely is a bug (confirmed in CF 7.02).
CF does not pass the correct data to the underlying WebCharts engine. The Webcharts engine displays duplicate slices correctly (if it gets them).

Report this at http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform .
Be sure to mention how much time and/or dollars this has cost you.

In the meantime use the attached code code as one possible workaround.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 28, 2007 Jan 28, 2007

Copy link to clipboard

Copied

LATEST
I'm not aware that this is a confirmed bug. Bug or not, what is commonly known is that cfchart uses just a fraction of the functionality Coldfusion gets from the WebCharts engine. It is not easy to tell when a deficiency of the tag is by design or when it is a bug.

However, Coldfusion redeems itself a little. You can use its webcharts engine to build your own custom charts, as MikerRoo has hinted. If you're on Windows, all you need to do is to double-click on C:\CFusionMX7\charting\webcharts.bat. You should then get a webcharts interface.

Choose a chart-type from the Chart Gallery and press OK. You can customize the chart by changing the values in the Property/Value table in the Design tab. The engine registers such changes automatically in the Code View tab. For more on the classes in the code, have a look at the WebCharts3D v5.0 Developer’s Guide.

Here is an example based on your query.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation