How to position legend chart labels?

2019-02-26 08:58发布

问题:

Is it possible to change the default positions of the legend labels around the jasper reports charts? Currently I have a following kind of chart being created:

I would like to move this [hoursNormal, hoursTravel, hoursOvertime]-box from under the chart to the right side of the chart. Another thing I would like to do is to replace this [hoursNormal, hoursTravel, hoursOvertime]-box by label "month". I just don't see any tools for moving these positions in Jasper studio chart creation wizard, and to me also the xml looks like so static that I don't believe tinkering it would help me.

Hopefully I'm wrong and there is a easy solution?

回答1:

Move the legend to the right and other option of the chart can be find in the Properties View.

Click the chart, to view Properties for the chart. Navigate the different properties tabs to set what you need.

Example

If you need more advanced feature on the chart you need to use a customizer class see this as example: How to put benchmark line on barchart?