我的应用程序中有很多图表有没有办法用json使y轴更动态。我正在使用coldfusion 11。请查看我的代码
<cfchart
format="#format#"
chartheight="320" chartwidth="690" showborder="yes"
title="Trend in Subject Rents" style="20currency.js" name="TwntyQtrGraph1" tipstyle="mouseOver"
tooltip="#Deserializejson(stc_fields)#" gridlines="#GraphInterval#">
<cfchartseries type="line"
serieslabel="Gross"
seriescolor="navy" markerStyle="diamond" paintStyle="plain" >
<cfloop query="qry_subproperty">
<cfset variables.Yearquarter=ObjPropDetails.JoinYearQuarter(qry_subproperty.Yearquarter)>
<cfchartdata item="#variables.Yearquarter#" value="#round(qry_subproperty.Gross)#" >
</cfloop>
</cfchartseries>
您可以通过cfchart中的yAxis属性设置最大值和步长间隔。这些值可以是动态的。如果您想要"值",也可以设置一个值数组:[002004006008001000]。scalefrom、scaletop和间隔(例如值:100:500:10)技术似乎不起作用。但正如我所说,使用最大值和步长可以得到相同的结果。
<cfset yAxis = {"min-value":"0","max-value":"1000","step":"200"}>
<cfchart
format="#format#" yAxis="#yAxis#"
chartheight="320" chartwidth="690" showborder="yes"
title="Trend in Subject Rents" style="20currency.js" name="TwntyQtrGraph1" tipstyle="mouseOver"
tooltip="#Deserializejson(stc_fields)#" gridlines="#GraphInterval#">
<cfchartseries type="line"
serieslabel="Gross"
seriescolor="navy" markerStyle="diamond" paintStyle="plain" >
<cfloop query="qry_subproperty">
<cfset variables.Yearquarter=ObjPropDetails.JoinYearQuarter(qry_subproperty.Yearquarter)>
<cfchartdata item="#variables.Yearquarter#" value="#round(qry_subproperty.Gross)#" >
</cfloop>
</cfchartseries>
</cfchart>