我想限制由cfchart创建的图表的x轴。我看到了限制y轴的scaleFrom和scaleTo属性,但没有看到限制x轴的属性。
此外,我在这里看到了一个类似的问题:ColdFusion Chart x-axis label limits,但这两个答案都不合适。据我所知,ScaleMin和ScaleMax并不存在,另一个答案比我想做的要复杂得多。
发布于 2012-10-11 07:02:58
索尔提到的scaleMin和scaleMax属性仅在使用custom style时可用。注意,使用"scale“类型意味着您的xAxis值必须是数字。如果你想使用字符串,你可能需要使用Ben的方法。
下面是一个在xAxis上创建包含24个点的图表的快速示例。即使查询只包含前六(6)个点。
<!--- bare bones style --->
<cfsavecontent variable="style">
<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false" isInterpolated="true">
<frame xDepth="3" yDepth="1" />
<xAxis type="Scale" scaleMin="0" scaleMax="24" labelCount="25" isBucketed="false" />
</frameChart>
</cfsavecontent>
<!--- sample query --->
<cfset qry = queryNew("")>
<cfset queryAddColumn(qry, "xValue", listToArray("1,2,3,4,5,6"))>
<cfset queryAddColumn(qry, "yValue", listToArray("30,15,22,14,45,5"))>
<!--- chart code --->
<cfchart format="jpg" style="#style#" width="600">
<cfchartseries type="line"
markerstyle="circle"
query="qry"
itemColumn="xValue"
valueColumn="yValue" />
</cfchart>https://stackoverflow.com/questions/12827872
复制相似问题