Вопрос

I have created a pie chart using the cfchart tag and as of the moment the labels for the chart data show outside of the pie chart, where I would like them placed inside each respective slice. I've looked through CF documentation but can seem to find a easy way to accomplish this. Can anyone shed some light on how I can just make the labels show inside each slice of the pie rather than outside?

Thank you!!!

I've tried using the following code and then using the cxml variable as the value for the style attribute on the cfchart tag. This does indeed set the labels inside the slices, but it also makes the pie chart have an odd shading to it. In addition, before applying this style I can set a value for the url parameter of the cfchart tag and cause a javascript function to fire when each slice is clicked. With the style applied, it's like it breaks each slice into separate clickable areas.

<cfsavecontent variable="cxml">
<?xml version="1.0" encoding="UTF-8"?>
<pieChart depth="Plain" style="Solid" is3D="false">
    <dataLabels style="value" placement="Inside" foreground="white" font="Arial-12"/>
</pieChart>
</cfsavecontent>


<cfchart format="png" style="#cxml#"....>
Это было полезно?

Решение

Using the WebCharts3D application that ships with ColdFusion 8, I was able to copy the XML. The following is what worked for me:

        <cfsavecontent variable="cxml">
        <?xml version="1.0" encoding="UTF-8"?>
        <pieChart depth="Plain" style="Solid" is3D="false">
        <legend spacing="0" placement="Right" font="Dialog-11">                 
            <decoration style="None" />
        </legend>            
        <paint palette="PastelTransluent" paint="Plain" min="44" max="95"/>
        </pieChart>
        </cfsavecontent>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top