Jump to content
We've recently updated our Privacy Statement, available here ×

luizruiz

Members
  • Posts

    2
  • Joined

  • Last visited

luizruiz's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hi, In the code above, if element is in headerCell, it's overwrite with null, the test is missing. Code: public static JRElement getElementByKey(JRCrosstab crosstab, String key) { JRElement element = null; if (crosstab.getHeaderCell() != null) { element = crosstab.getHeaderCell().getElementByKey(key); } element = getHeadersElement(crosstab.getRowGroups(), key); if (element == null)
  2. Hi Teodord, Your solution works fine. I try to use the label expression inside the dataset, to avoid to change the custumizer every time I went to change the label format. With a little change in your code, it can be done. Code: public void customize(JFreeChart jFreeChart, JRChart jrChart) { JRFillPieDataset dataset = (JRFillPieDataset) jrChart.getDataset(); if (dataset.getLabelExpression() != null) { String label = dataset.getLabelExpression().getText(); label = label.substring(1, label.length() - 1); PiePlot piePlot = (PiePlot) jFreeChart.getPlot(); StandardPieSectionLabelGenerator labelGenerator = new StandardPieSectionLabelGenerator(label); piePlot.setLabelGenerator(labelGenerator); piePlot.setLegendLabelGenerator(labelGenerator); } } I hope this can help! Luiz Augusto Ruiz
×
×
  • Create New...