Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10298

Allow customizing pie chart labels

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 6.1-milestone-1
    • 6.0-rc-1
    • Chart
    • None
    • Unknown

    Description

      For example if you wish to display the percentage in the label it's currently not possible.

      My proposal is to add a new parameter named "pie_label_format" for that.

      When this issue is fixed you'll be able to use:

      {{chart type="pie" source="xdom" params="document:ActiveInstalls.VersionsData;range:B2-B.;series:columns;pie_label_format:{0} - {2}"/}}
      

      See http://www.jfree.org/jfreechart/api/gjdoc/org/jfree/chart/labels/StandardPieSectionLabelGenerator.html to understand the format.

      Technically this calls the following jfreechart API:

              // Allow customizing the label to use
              String pieLabelFormat = parameters.get(PIE_LABEL_FORMAT_KEY);
              if (pieLabelFormat != null) {
                  piePlot.setLabelGenerator(
                      new StandardPieSectionLabelGenerator(pieLabelFormat, NumberFormat.getNumberInstance(),
                          NumberFormat.getPercentInstance()));
              }
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: