Skip to main content
July 18, 2007
質問

How to customise charting styles?

  • July 18, 2007
  • 返信数 2.
  • 1398 ビュー
Hi,

I'm currently looking for a way to customise the styles available in cfchart. I have to place 9 charts on an A4 page in landscape i.e. 3 rows of 3 charts, each of size width 280 and height 190.

Is there anybody who can please help me with the following?

1. If you choose a particular size in the fontsize attribute of the cfchart tag, all labels have this size. Is there a way to style the fontsize of the x-axis data labels to be smaller, independently of the fontsize of the remaining labels? Something similar to MS Excel.

2. Is there a way to increase the graph area? Ok, you would say make the fonts smaller. But at a certain fontsize, e.g. below Arial Narrow font size 8, it is barely readable. I want to be able to resize the graph area e.g. like in MS Excel or Crystal Reports. Is there a way to do this?

3. Can the position of the legend be changed? By default it appears in the centre on top of the charts. Is there a way to position it differently?

You can imagine with the space available to place 3 charts of width 280px next to each other, the display will definitely suffer, especially if e.g. the x-axis data labels are quite long.

In fact, the only things that I've already changed are:
1. x-axis orientation to vertical in default.xml
2. using Arial Narrow size 8

Your help will be greatly appreciated.

Thanks and regards,
Yogesh Mahadnac
このトピックへの返信は締め切られました。

返信数 2

BKBK
Community Expert
Community Expert
July 26, 2007
when I try to use this style in the cfchart style="myStyle"
I don't think you should use your kind of style with the usual cfchart tag. It works best with the approach elaborated in:

http://www.webcharts3d.com/website/WebCharts50/cf/tag.jsp

July 23, 2007
Thanks!
July 26, 2007
Hi,

Ok, I've used the webcharts.bat file in the "CFusionMX7\charting" directory to create a style called myStyle.xml which I've saved in the "CFusionMX7\charting\styles\" directory. See code below.

However when I try to use this style in the cfchart style="myStyle" the x-axis font DOESN'T display font size 8!!!

I need to MANUALLY set the font attributes.

<cfchart font="Arial Narrow" fontsize="8">

Any idea why this is so, or any idea how to customise the charts further?

Thanks and regards,
Yogesh Mahadnac



<?xml version="1.0" encoding="UTF-8"?>

<frameChart is3D="false" font="Arial Narrow-8" isMultiline="true">

<frame xDepth="6" yDepth="6" outline="black" gridColor="#CCCCCC"/>

<xAxis>
<labelFormat pattern="#,##0.###"/>
<parseFormat pattern="#,##0.###"/>
<labelStyle orientation="Vertical" color="black"/>
<titleStyle font="Arial Narrow-8"/>
</xAxis>

<yAxis scaleMin="0">
<labelFormat pattern="#,##0.###"/>
<parseFormat pattern="#,##0.###"/>
<labelStyle color="black"/>
<titleStyle font="Arial Narrow-8" foreground="black"/>
</yAxis>

<yAxis2>
<labelFormat pattern="#,##0.###"/>
<parseFormat pattern="#,##0.###"/>
<labelStyle color="black"/>
<titleStyle font="Arial Narrow-8" foreground="black"/>
</yAxis2>

<topYAxis>
<labelFormat pattern="#,##0.###"/>
<parseFormat pattern="#,##0.###"/>
<labelStyle color="black"/>
<titleStyle font="Arial Narrow-8" foreground="black"/>
</topYAxis>

<topYAxis2>
<labelFormat pattern="#,##0.###"/>
<parseFormat pattern="#,##0.###"/>
<labelStyle color="black"/>
<titleStyle font="Arial Narrow-8"/>
</topYAxis2>

<dataLabels font="Arial Narrow-8"/>

<legend spacing="3" valign="Top" halign="Right" useMarkers="true"
font="Arial Narrow-9">
<decoration style="None"/>
</legend>

<elements outline="black" shapeSize="40" lineWidth="2" fixedWidth="2">
<morph morph="Grow" stage="Cols"/>
</elements>

<table cellPadding="0" border="None">
<decoration style="None"/>
</table>

<title spacing="2" font="Arial Narrow-8-bold"/>

<paint isVertical="true" min="47" max="83"/>

</frameChart>