ColdFusion 11 cfchart xAxis format

I am trying to create a simple line chart in ColdFusion 11 and would like to format xAxis to show a date format like mm-dd-yy, for example, instead of the full date / timestamp that is displayed by default.

My code is:

      <cfchart format="html"
               chartwidth="800"
               chartheight="400"
               xaxistitle="Date"
               yaxistitle="Amount"
               showlegend="yes"
               fontsize="12"
               font="Arial"
               showMarkers="no"
               xAxis=#[{"format"="Date","label":"Date"}]#>

        <cfchartseries type="line"
                      query="getAmounts"
                      valueColumn="amount"
                      itemColumn="date">

      </cfchart>

The xAxis attribute gives this error:

You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members.

I tried several different variations of the xAxis attribute with no luck - the documentation is unclear in what format it should be. Any help would be appreciated.

+4
source share
1 answer

The format should be something like this ...

<cfset myStruct = {"item"={"font-angle"=-90}}/>

xAxis = "# myStruct #" - cfchart, , . , , . , , xAxis. : " , x, , , ".

, "" "getAmounts"? , .

+1

Source: https://habr.com/ru/post/1618919/


All Articles