Jump to content
Changes to the Jaspersoft community edition download ×
  • How to wrap labels in pie Chart Pro?


    nbochenko
    • Features: Charts Version: v5.0 Product: JasperReports® Library

    Issue

    Occasionally the labels are too big for the Pie Chart and do not fit into the chart. Is there a way to control this behaviour?


    Solution

    You can use Fusion Charts properties for that. If you check Fusion docs you will find this property:

    <chart ...="" managelabeloverflow="1" ...>
    

    Essentially it will wrap the labels if there is enough space.

    You can apply this in a Pie Chart in this manner:

    <fc:chart type="Pie"
              xmlns:fc="http://jaspersoft.com/fusion"
              xsi:schemalocation="http://jaspersoft.com/fusion http://jaspersoft.com/schema/fusion.xsd">
        <fc:chartproperty name="manageLabelOverflow">
            <fc:propertyexpression>
                <!--[CDATA["1"]]-->
            </fc:propertyexpression>
        </fc:chartproperty>
        ...
    </fc:chart>
    
    BeforeAfter
    labelnotwrapped.png.60537c528ae7a4b5622a93168700d5c2.pnglabelwrapped.png.240fdee588ebf731361ca848c1307d92.png

    You can find some other available properties in Fusion Charts documentation.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...