我在Coldfusion 10中创建了一个简单的图表。由于某些原因,Y轴上的标签太拥挤了。如果它们是长文本(尽管不能超过100个字符),它们仍应单行显示而不是换行。这是屏幕截图:
<cfchart chartheight="1000" chartwidth="1000" showxgridlines="no" showygridlines="no" showborder="no" fontbold="no" fontitalic="no" show3d="no" rotated="no" sortxaxis="no" showlegend="no" showmarkers="no" format="jpg" xaxistitle="Issues">
<cfchartseries type="horizontalbar" serieslabel="Survey Count" >
<cfchartdata item="lwkencfkenklnr lknevfvfv ghthrtg y;l;lm;'m jkbjed lknl klnelvkn lknlknrweknn" value="10">
<cfchartdata item="lewfll; ;lmrtgbjweb vkn wkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfewflfojewmlrm" value="20">
<cfchartdata item="efklnwkln lknkleng lwkencfkenefe klnr lknevlknl klnelvkn lknlknrweknn ewe" value="40">
<cfchartdata item="lkenglk klkn kjbghdchg lwk ewefrewf ncfkenklnr lknevlknl klnelvkn lknlknrweknn" value="10">
<cfchartdata item="lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="60">
<cfchartdata item="lwkencfkenklnr lkneffvlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="80">
<cfchartdata item="lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="50">
<cfchartdata item="lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="5">
<cfchartdata item="lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="100">
<cfchartdata item="lwkencfke btgnklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="20">
<cfchartdata item="lwkencfkenklnr lknevlvvrgr knl klnelvkn lknlknrweknn wcwfojewmlrm" value="10">
<cfchartdata item="lwkencfkenklnr lkneffvfg vlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="50">
<cfchartdata item="lwkffdfdf encfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="60">
<cfchartdata item="lwkenc hy jujuyjj fkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="10">
<cfchartdata item="lwkencrfrf fkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="80">
<cfchartdata item="lwkencfrfrf h thtt yyuyu kenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="25">
<cfchartdata item="lwkencefef ferrgrg fkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="38">
<cfchartdata item="lwken hthththcfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="2">
<cfchartdata item="jjkjkkjbjk lwkencfkeefefnklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="120">
<cfchartdata item=";l;m;';' frfegtgrt tgt kencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="12">
<cfchartdata item="knklnknk lknlkne lknklnewf lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="55">
<cfchartdata item="el;mvlml ;lmlmll ';,;lwkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="88">
<cfchartdata item="lwkg;lm;l ';,;' nkneknfv encfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="6">
<cfchartdata item="knklnekgn klnqd legegwkeeg ncfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="10">
<cfchartdata item="lwgerg;,e;' ';,hytlhmwjkbfh kjkencfkenklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="25">
<cfchartdata item="lwkencfkenfwekfnwkln knklnklnd l;ml;fklnr lknevlknl klnelvkn lknlknrweknn wcwfojewmlrm" value="150">
</cfchartseries>
谢谢。
最佳答案
CF10使用多个图表引擎:ZingChart用于format="html"
,WebCharts3D用于所有其他格式,即"flash|jpg|png"
。
如前所述,直接使用ZingCharts将提供更多控制。但是,为回答您的问题,您当前的图表是使用WebCharts3D生成的。您可以使用custom style修改图表的行为。要禁用包装,请使用isMultiline="false"
。 (另请参见{cfroot\charting\webcharts.bat}
中的制图实用程序)。
<cfsavecontent variable="customStyle"><?xml version="1.0" encoding="UTF-8"?>
<frameChart>
<xAxis>
<labelStyle isMultiline="false" isHideOverlapped="false" orientation="Horizontal"/>
</xAxis>
</frameChart>
</cfsavecontent>
<cfchart style="#customStyle#"
chartheight="1000"
chartwidth="1000" ....>
</cfchart>
关于coldfusion - cfchart单杠标签拥挤,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19151422/