Coldfusion 11中带有Json的动态Y轴
我的应用程序中有很多图表,是否有任何方法可以使用json使y轴更加动态。我正在使用coldfusion 11。请看我的密码Coldfusion 11中带有Json的动态Y轴,json,coldfusion,cfchart,Json,Coldfusion,Cfchart,我的应用程序中有很多图表,是否有任何方法可以使用json使y轴更加动态。我正在使用coldfusion 11。请看我的密码 <cfchart format="#format#" chartheight="320" chartwidth="690" showborder="yes" title="Trend in Subject Rents" style="20currency.js" name="TwntyQtrGraph1
<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属性设置最大值和步长间隔。这些值可以是动态的。如果需要“值”,还可以设置值数组:[020040006008001000]。scalefrom、scaletop和interval(例如值: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>
问题不清楚。你的y轴现在看起来像什么?你希望它看起来怎么样?诚实,直接使用ZingCharts,而不是通过使用cfhart
,实际上更容易。他们甚至有一个“图表生成器”,允许您构建一个JSON字符串,允许您使用图表类型、格式、样式等。然后您可以使用CF构建一个类似的JSON字符串。-@Divya你到底想让什么更有活力?y轴项目的数量?@AlanBullpitt我想让我的y轴更具动态性根据图中的值绘图,我知道在json中我们有“值”来指定scalefrom、scaletop和间隔(例如值:100:500:10)那么,如何在我的cf页面中使用动态values@ScottStroz我从zingchart.com获得了'Values'属性,但我想在cf页面中使用动态数字的'Values'。我不知道如何在我的cf页面中表示json。我是CF新手,请帮忙