Timothy Ruhle
Timothy Ruhle

Reputation: 7597

cfchart pie chart with dataLabelStyle

According to this page http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-792e.html you can use a dataLabelStyle which can be "none", "value", "rowLabel", "columnLabel" or "pattern". However whenever i use "rowLabel", "columnLabel" or "pattern" the image doesn't show. There is no error, just a blank canvas where the image should be. Does any one know how to work around this?

Thanks

Upvotes: 0

Views: 2174

Answers (2)

Kim Wilson
Kim Wilson

Reputation: 107

I had the same problem, and I found that when I add the legend attribute placement, that is when the chart disappears. The legend shows with the placement indicated, but no chart.

I finally figured out what to do, I started from scratch with the bare minimum pie chart with examples from this page: WebCharts3D Piecharts

And I discovered that the order of the elements in the XML file was the issue.

This is how my XML file is now and it works:

<?xml version="1.0" encoding="UTF-8"?>

<paint paint="Plain" />

<title>
   <decoration style="None"/>
</title>

<dataLabels style="Pattern" font="Arial-16-bold">

   <![CDATA[
     $(value),  $(colPercent)
    ]]>

</dataLabels>

<legend placement="Right" font="Arial-16">
      <decoration style="None"/>
</legend>

<insets left="10" top="10" right="5" /> 

<elements action="" shape="Area" drawOutline="false">
    <morph morph="Blur" /> <!-- other options: grow, none -->
    <series index="0">
        <paint color="#E48701" /> <!-- orange -->
    </series>
    <series index="1">
        <paint color="#A5BC4E" /> <!-- lime -->
    </series>
    <!-- ...(etc) --> 
  </elements>
</pieChart>

Upvotes: 2

Leigh
Leigh

Reputation: 28873

This test of the five(5) styles works fine for me.

Maybe it is your code? Probably not a version problem as dataLabelStyle was introduced back in MX7 .

<cfloop list="value,rowLabel,columnLabel,pattern,none" index="style">
    <cfchart format="png" scaleFrom="0" scaleto="30">
        <cfchartseries type="bar" dataLabelStyle="#style#">
            <cfchartdata item="bar" value="25">
            <cfchartdata item="foo" value="10">
        </cfchartseries>
    </cfchart>
</cfloop>

Upvotes: 1

Related Questions