cfchart忽略了我的scalefrom值

我的页面中有以下代码。 样式变量保存自定义样式。
  <cfchart chartheight="450" chartwidth="550" gridlines="9"   yaxistitle="Score" scalefrom="20" scaleto="100" style="#style#"   format="png" >
         <cfchartseries query="variables.chart_query" type="scatter"   seriescolor="##000000" itemcolumn="MyItem" valuecolumn="MyScore"/>
     </cfchart>
在开始之前,请参阅chart_good.jpg。这就是我希望我的报告出现的方式。在x轴上,只要其中至少有一个具有值,就会有三个项目。如果某个项目没有任何值(即2010),则图表中不会有标记。 仅当只有一个项具有值时才会出现此问题。请参阅chart_bad.jpg。如您所见,2008年和2010年没有任何价值; y轴现在从0到100缩放。我尝试将其中一个项目(例如2008)设置为0或者图表之外的东西;它会根据这个图表外的价值和2009年的价值进行扩展。简而言之,我必须至少有两个值在20到100之间的项目,以便cfchart从20到100扩展。 我的问题是,我如何纠正这个问题,以便cfchart总是从20级扩展到100级?我正在运行CF9。     
已邀请:
你的风格变量里面有什么? 我建议不要在cfchart标签中使用scaleFrom =“”和scaleTo =“”,因为它们有时会出错。我相信Coldfusion的cfchart标签会尝试自动将图表缩放到它认为最合适的位置。相反,我会在frameChart标记内构建图表的最小和最大比例。 用于构建图表的样式变量的示例
<cfsavecontent variable="style">
  <?xml version="1.0" encoding="UTF-8"?>

  <frameChart is3D="false" font="Arial-11-bold">
    <frame xDepth="0" yDepth="0" outline="black" lightColor="#CCCCCC" darkColor="#CCCCCC"
            wallColor="#CCCCCC" frameSize="5" dashSize="3" gridColor="#333333">
        <background type="HorizontalGradient" maxColor="#828EB0"/>
    </frame>



    <!---  THE BREAD AND BUTTER 
           NOTE: if you use variables for the scaleMin and scaleMax
           make sure to surround them with a cfoutput tag
    --->

    <yAxis scaleMin="20" scaleMax="100">
    <!--- --------------------- --->

        <labelFormat style="Currency" pattern="#,##0"/>
        <parseFormat pattern="#,##0"/>
        <titleStyle></titleStyle>
    </yAxis>

    <legend allowSpan="true" isVisible="false" placement="Bottom" valign="Bottom" foreground="black"
            isMultiline="true">
        <decoration style="None"/>
    </legend>

    <elements outline="black" shapeSize="40"/>
    <popup background="#748BA6" foreground="white"/>
    <paint palette="Modern" paint="Plain" isVertical="true"/>
    <insets right="5"/>

   </frameChart>

</cfsavecontent>
然后,您所要做的就是将变量加载到您已经提到的样式属性中。
<cfchart format="png" chartWidth="550" chartHeight="175" style="#style#">
也是一个很好的资源,Webcharts程序将在你的C:/ coldfusion / charting /目录中。只需打开webcharts.bat,创建自定义图表,将xml代码复制到样式变量中,然后中提琴! 如果您决定使用此路线,请务必从cfchart标记中删除scaleTo =和scaleFrom =。     

要回复问题请先登录注册