我正在使用WebCharts3D接口创建和修改图表,然后在Coldfusion代码中使用生成的XML样式作为内联样式。
因此,这将在WebCharts3D中正确显示:
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>这只显示了示例标题,周围没有方框,并设置为所需的字体大小和粗细。您可以将这段代码复制到WebCharts "XML Style“窗口中,应用它,然后看看它是否正常工作。
我在我的Coldfusion代码中使用了如下代码:
<cfsavecontent variable="piecontent">
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Double" style="Solid">
<title font="Arial-18-bold">
<decoration style="None"/>This is a title
</title>
</pieChart>
</cfsavecontent>
<cfchart name="mychart" format="png"
style="#piecontent#">
<cfchartseries type= "pie">
<cfchartdata item="sample1" value="10">
<cfchartdata item="sample2" value="20">
</cfchartseries>
</cfchart>标题正确地将“装饰”设置为“无”,因为它周围没有方框,但标题的字体大小和粗细被完全忽略。这是一个bug吗?有解决办法吗?
编辑:看起来这个忽略字体大小和粗细的问题也适用于整个字体,就像你放这个:<pieChart depth="Double" style="Solid" font="Arial-16-Bold">。
发布于 2012-08-21 20:29:58
这些特殊的设置似乎被忽略了,取而代之的是cfchart标签的字体属性。请尝试使用这些选项:
<cfchart format="png" font="Arial" fontBold="true" fontSize="18">EDIT:虽然上面的功能只适用于饼图,但它看起来像是另一个错误……真正起作用的是interfacing with webcharts directly。它更复杂,但提供了对图表设置的完全控制。
发布于 2012-08-21 20:05:11
我的经验是,除了我自己的测试之外,我在网上找不到任何证据,那就是ColdFusion的Webcharts实现不支持设置标题的样式。
https://stackoverflow.com/questions/12043316
复制相似问题