1

在 ColdFusion 中工作并尝试运行此图表,但我遇到了一个奇怪的错误。

我不确定如何或为什么,但 Y 轴下限设置为 -1000 而不是零。我的数据都没有低于 0。在图片中,我将其设置为Seriesplacement=Stacked. 但这只是为了测试。否则这是我的代码。

<cfchart title = "#variables.ReportName# Seedlings Ordered"
style = "../SO_R_overall.xml"
Format = "PNG"
pieSliceStyle = "solid"
show3D = "no"
showBorder = "yes" 
showLegend = "yes"
tipStyle = "MouseOver"
chartHeight = "#DefinedChartHeight#" 
chartWidth = "#DefinedChartWidth#"
font="arial"
fontsize="12"
fontBold="yes"
scaleFrom="0"
>

<cfchartseries 
    type="bar"
    seriesLabel="Goal"
    query="getDivisionGoalsByDivision"
    valueColumn="divisiongoal"  
    itemColumn = "division"
    dataLabelStyle="Value"
    seriesColor="99CCFF"
    >           
</cfchartseries>    

<cfchartseries 
    type="line"
    seriesLabel="Ordered"
    query="getQTYordered"
    valueColumn="QTYordered"  
    itemColumn = "division"
    dataLabelStyle="Value"
    seriesColor="green"
    >           
</cfchartseries>

以及正在使用的 XML:

<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false">
    <frame xDepth="3" yDepth="3" outline="#333333" lightColor="white" 
    leftAxisPlacement="Front" rightAxisPlacement="Front" stripColor="#CCCCCC"/>
    <xAxis scaleMin="0">
        <labelStyle isHideOverlapped="false" orientation="Horizontal"/>
        <titleStyle font="Arial-10-bold" isMultiline="true">Division</titleStyle>
    </xAxis>
    <yAxis scaleMin="0">
        <titleStyle font="Arial-10-bold"/>
        <dateTimeStyle majorUnit="Year" minorUnit="Month"/>
        <labelFormat style="Pattern" pattern="#,##0"/>
    </yAxis>         

    <dataLabels font="Arial-10" foreground="black" autoControl="true"/>
    <legend> 
        <![CDATA[ $(rowLabel)  ]]>    
    </legend>

    <elements action="" shape="Area" drawOutline="false">
        <morph morph="Grow"/>
    </elements>

    <decoration style="RoundShadow"/>
    <popup background="#C8FFFFFF" foreground="#333333"/>
    <paint paint="Plain"/>
    <insets left="5" top="5" right="5" bottom="5"/>

生成的图表: 在此处输入图像描述

4

1 回答 1

4

AH! In the XML line 2 I changed

<frameChart is3D="false">

to

<frameChart is3D="false" autoAdjust="false">

UPDATE: See comments below for context and explanation.

于 2014-10-28T14:28:54.250 回答