coldfusioncoldfusion-9cfchart

CfChart Stacked bars and unstacked Lines


I am trying to create a CFChart with Stacked Bars and unstacked Lines. Have been trying to work around in the Webcharts Tool but no luck so far. ExampleStacked Chart

In the example image all the series are seriesplacement=stacked, but I want to have the bars(Avg and TDD) as stacked and the lines (Max and Min) as seriesplacement=default. Is there a way to achieve the same in Cfchart?


Solution

  • If I am understanding correctly, just set the placement of the line series in your xml style:

    <?xml version="1.0" encoding="UTF-8"?>
    <frameChart>
        <elements place="Stacked" drawOutline="false">
            <series index="0" place="Default" shape="Line" />
            <series index="1" place="Default" shape="Line" />
      </elements>
    </frameChart>
    

    Then generate a "stacked" chart as usual:

    <cfchart format="png" style="#yourCustomStyle#">
        <cfchartseries type="line" serieslabel="Min">
          ...
        </cfchartseries>
        <cfchartseries type="line" serieslabel="Max">
            ...
        </cfchartseries>
        <cfchartseries type="bar" serieslabel="Avg" >
            ...
        </cfchartseries>
        <cfchartseries type="bar" serieslabel="TDD">
            ... 
        </cfchartseries>
    </cfchart>