Coldfusion cfchart忽略我的scalefrom值

Coldfusion cfchart忽略我的scalefrom值,coldfusion,cfchart,Coldfusion,Cfchart,我的页面中有以下代码 style变量保存自定义样式 <cfchart chartheight="450" chartwidth="550" gridlines="9" yaxistitle="Score" scalefrom="20" scaleto="100" style="#style#" format="png" > <cfchartseries query="variables.chart_query" type="scatter" s

我的页面中有以下代码

style变量保存自定义样式

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

在我开始之前,请看一下。这就是我想要我的报告的方式。在x轴上,只要至少有一个项目具有值,则始终会有三个项目。如果某个项目没有任何值(即2010年),则图表中不会有标记

只有当只有一个项具有值时才会出现问题。请看。如您所见,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>

然后,您所要做的就是像前面提到的那样将变量加载到style属性中

<cfchart format="png" chartWidth="550" chartHeight="175" style="#style#">

还有一个很好使用的资源是Webcharts程序,它将位于您的C:/coldfusion/charting/目录中。只需打开webcharts.bat,创建自定义图表,将xml代码复制到样式变量中,瞧


如果您决定这样做,请确保从cfchart标记中删除scaleTo=和scaleFrom=。

如果2008有值,但2010没有值,会发生什么?同样的事情?是的,同样的事情发生了。你能发布一个变量的cfdump吗?图表查询?这是cfdump