带有dataLabelStyle的cfchart饼图

时间:2011-07-28 01:27:48

标签: coldfusion cfchart

根据此页面http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-792e.html,您可以使用dataLabelStyle,它可以是“none”,“value”,“rowLabel”,“columnLabel”或“pattern”。但是,每当我使用“rowLabel”,“columnLabel”或“pattern”时,图像都不会显示。没有错误,只有一个空白的画布应该是图像。有没有人知道如何解决这个问题?

由于

2 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,我发现当我添加图例属性放置时,就是图表消失的时候。图例显示的是展示位置,但没有图表。

我终于想出了该怎么做,我从头开始用最小的饼图和本页的例子: WebCharts3D Piecharts

我发现XML文件中元素的顺序是个问题。

这就是我的XML文件现在的运作方式:

<?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>

答案 1 :(得分:1)

这五种风格的测试对我来说很好。

也许这是你的代码?可能不是版本问题,因为dataLabelStyle是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>