1

Working in ColdFusion and trying get this chart running and I've run into an odd bug.

I'm not sure how or why but the lower Y-Axis limit is being set to -1000 instead of zero. None of my data goes below 0. In the picture I've got it set to Seriesplacement=Stacked. But that was just to test. Otherwise here's my code.

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

And the XML being used:

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

Generated chart: enter image description here

Leigh
  • 28,765
  • 10
  • 55
  • 103
henonChesser
  • 167
  • 1
  • 14

1 Answers1

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.

henonChesser
  • 167
  • 1
  • 14
  • I guess I get why it works in theory. It shouldn't be a factor because my query isn't returning negative values. But if it was this could be a fix. I just wish there was more documentation for the XML side of CFCHART. – henonChesser Oct 28 '14 at 14:53
  • I'm with you. I'm going to save this post as a nice tip. – Mark A Kruger Oct 28 '14 at 15:06
  • 1
    @henonChesser - It is not strictly a matter of the values. It is about how charting engine translates the values in terms of scale and margins. Basically `autoAdjust` means you leave it up to the engine to determine what is the best fit. Usually it does a pretty good job, but not always. BTW, for more info on the attributes, look in the webcharts3d docs in the charting tool ie webcharts.bat on the "Help" tab. – Leigh Oct 28 '14 at 19:45