TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 403 forks source link

Chart theme legend not showing - regression bug #279

Closed chris-landclan closed 2 years ago

chris-landclan commented 2 years ago

Somewhere between version 6.17.0 and 6.19.1 the chart theme legend has become affected by a bug that is causing chart legends to no longer show.

The following screenshot shows how the legend was working in version 6.17.0:

image

The following screenshot shows the legend in version 6.19.1:

image

Notice that the legend is not showing in version 6.19.1. (The padding on the title is also not being applied - I have raised this as a separate issue).

Here is the jrctx file contents:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio -->
<chart-theme>
    <chart-settings background-image-alignment="Align.TOP_RIGHT" background-image-alpha="1.0" border-visible="false" anti-alias="true" text-anti-alias="true">
        <background-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FFFFFF" xsi:type="color"/>
        <font/>
        <border-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <stroke width="1.0"/>
        <padding top="1.1" left="8.0" bottom="3.3" right="4.4"/>
    </chart-settings>
    <title-settings show-title="true" position="Top" horizontal-alignment="HorizontalAlignment.LEFT" vertical-alignment="VerticalAlignment.CENTER">
        <foreground-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <background-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FFFFFF" xsi:type="color"/>
        <font font-name="IBM Plex Sans Medium" font-size="16.0" bold="false"/>
        <padding top="1.1" left="54.0" bottom="3.3" right="4.4"/>
    </title-settings>
    <subtitle-settings show-title="false" position="Top" horizontal-alignment="HorizontalAlignment.CENTER" vertical-alignment="VerticalAlignment.TOP">
        <foreground-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <background-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#A3A3A3" xsi:type="color"/>
        <font bold="true"/>
        <padding top="1.1" left="2.2" bottom="3.3" right="4.4"/>
    </subtitle-settings>
    <legend-settings show-legend="true" position="Top" horizontal-alignment="HorizontalAlignment.LEFT" vertical-alignment="VerticalAlignment.CENTER">
        <foreground-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <background-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FFFFFF" xsi:type="color"/>
        <font font-name="IBM Plex Sans Regular" font-size="14.0" bold="false"/>
        <frame xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="block-border">
            <insets top="0.0" left="0.0" bottom="0.0" right="0.0"/>
            <paint color="#000000" xsi:type="color"/>
        </frame>
        <padding top="1.1" left="2.2" bottom="3.3" right="4.4"/>
    </legend-settings>
    <plot-settings orientation="PlotOrientation.HORIZONTAL" background-alpha="0.0" background-image-alpha="0.5" background-image-alignment="Align.TOP_LEFT" label-rotation="0.0" outline-visible="true" domain-gridline-visible="true" range-gridline-visible="true">
        <background-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FFFFFF" xsi:type="color"/>
        <padding top="1.1" left="2.2" bottom="3.3" right="4.4"/>
        <outline-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="1.0" xsi:type="stroke"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#EA4336" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FABD05" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#34A853" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#366BEA" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#9AD2EF" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#CB4793" xsi:type="color"/>
        <series-color-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#00B1AE" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#EA4336" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FABD05" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#34A853" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#366BEA" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#9AD2EF" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#CB4793" xsi:type="color"/>
        <series-outline-paint-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#00B1AE" xsi:type="color"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="2.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <series-outline-stroke-sequence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="3.0" xsi:type="stroke"/>
        <domain-gridline-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <domain-gridline-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="0.5" xsi:type="stroke"/>
        <range-gridline-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <range-gridline-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="0.5" xsi:type="stroke"/>
        <tick-label-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="Arial" font-size="10.0" bold="true" xsi:type="font"/>
        <display-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="Arial" font-size="12.0" bold="true" xsi:type="font"/>
    </plot-settings>
    <domain-axis-settings visible="false" location="AxisLocation.TOP_OR_LEFT" line-visible="true" label-angle="0.0" label-visible="false" tick-labels-visible="true" tick-marks-inside-length="0.1" tick-marks-outside-length="0.2" tick-marks-visible="true" tick-count="5" axis-integer-unit="false">
        <line-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <line-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="1.0" xsi:type="stroke"/>
        <label-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <label-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="IBM Plex Sans Medium" font-size="10.0" bold="false" italic="false" xsi:type="font"/>
        <label-insets top="0.5" left="0.5" bottom="1.0" right="1.0"/>
        <tick-label-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#00FFFF" xsi:type="color"/>
        <tick-label-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="IBM Plex Sans Medium" font-size="10.0" bold="false" italic="false" xsi:type="font"/>
        <tick-label-insets top="0.5" left="0.5" bottom="0.5" right="0.5"/>
        <tick-marks-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <tick-marks-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="1.0" xsi:type="stroke"/>
    </domain-axis-settings>
    <range-axis-settings visible="true" location="AxisLocation.BOTTOM_OR_RIGHT" line-visible="true" label-angle="1.5707963267948966" label-visible="true" tick-labels-visible="true" tick-marks-inside-length="0.2" tick-marks-outside-length="0.1" tick-marks-visible="true" tick-count="6" axis-integer-unit="false">
        <line-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <line-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="1.0" xsi:type="stroke"/>
        <label-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#000000" xsi:type="color"/>
        <label-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="IBM Plex Sans Medium" font-size="10.0" bold="false" italic="false" xsi:type="font"/>
        <label-insets top="0.5" left="0.5" bottom="1.0" right="0.5"/>
        <tick-label-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#FFAFAF" xsi:type="color"/>
        <tick-label-font xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" font-name="IBM Plex Sans Medium" font-size="10.0" bold="false" italic="false" xsi:type="font"/>
        <tick-label-insets top="0.5" left="0.5" bottom="0.5" right="0.5"/>
        <tick-marks-paint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" color="#F4F4F4" xsi:type="color"/>
        <tick-marks-stroke xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" width="1.0" xsi:type="stroke"/>
    </range-axis-settings>
</chart-theme>
dadza commented 2 years ago

Thank you for reporting the problem. You can test the fix by downloading the latest snapshot jar (jasperreports-chart-themes-master-20220606.145620-11.jar) from https://jaspersoft.jfrog.io/ui/native/jr-ce-snapshots/net/sf/jasperreports/jasperreports-chart-themes/master-SNAPSHOT/

Regards, Lucian