我正在显示一个有一个或多个线系列的图表。数据来自查询,如果图表上有更多的序列,则该数据将正确工作。但是,如果只返回一个系列,则显示不正确。
下面是使用的代码:
<cfchart format="flash" tipstyle="mouseover" showlegend="yes" xaxistitle="Date" yaxistitle="Hits" chartwidth="1200" chartheight="300">
<cfoutput query="qryReport" group="APP_SYS_NR">
<cfchartseries serieslabel="#qryReport.APP_NA#" type="line">
<cfoutput>
<cfchartdata item="#DateFormat(qryReport.CDR_DT, "mm/dd/yyyy")#" value="#qryReport.TOT_HIT_CNT#">
</cfoutput>
</cfchartseries>
</cfoutput>
</cfchart>此图表顶部的黑屏区域列出了这两行所代表的内容的键:

在这个图表中(当只有一个APP_SYS_NR返回时),而不是只有一个标签,所有的日期都变成标签。显然不是我想要的:

编辑:我已经将其追溯到cfchart的show传奇属性。Adobe认为,如果图表包含多个数据系列,则是否显示图例。我想,当它只包含一个数据系列时,它就会完全自拔,并完成图例中的数据点。我在ColdFusion 9和ColdFusion 10上进行了测试。
发布于 2014-10-08 15:57:38
这里的解决方案是在只有一个系列要显示时,将显示图例设置为no。相反,您应该在该实例中使用图表标题。请参阅下列修改后的代码:
<cfset VARIABLES.blnShowLegend = "no">
<cfset VARIABLES.strChartTitle = "#qryReport.APP_NA#">
<cfif ListLen(URL.lstApps) GT 1>
<cfset VARIABLES.blnShowLegend = "yes">
<cfset VARIABLES.strChartTitle = "">
</cfif>
<cfchart format="flash" title="#VARIABLES.strChartTitle#" tipstyle="mouseover" style="appstats" showlegend="#VARIABLES.blnShowLegend#" xaxistitle="Date" yaxistitle="Hits" chartwidth="1200" chartheight="300">
<cfoutput query="qryReport" group="APP_SYS_NR">
<cfchartseries serieslabel="#qryReport.APP_NA#" type="line">
<cfoutput>
<cfchartdata item="#DateFormat(qryReport.CDR_DT, "mm/dd/yyyy")#" value="#qryReport.TOT_HIT_CNT#">
</cfoutput>
</cfchartseries>
</cfoutput>
</cfchart>https://stackoverflow.com/questions/26259125
复制相似问题