Class ChartUtil

java.lang.Object
net.sf.jasperreports.charts.util.ChartUtil

public final class ChartUtil extends Object
Author:
Teodor Danciu (teodord@users.sourceforge.net)
  • Field Details

    • AUTO_TICK_UNIT_THRESHOLD

      protected static final double AUTO_TICK_UNIT_THRESHOLD
      See Also:
    • AUTO_TICK_UNIT_FACTOR

      protected static final double AUTO_TICK_UNIT_FACTOR
      See Also:
  • Method Details

    • getInstance

      public static ChartUtil getInstance(JasperReportsContext jasperReportsContext)
    • getImageAreaHyperlinks

      public static List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(org.jfree.chart.JFreeChart chart, ChartHyperlinkProvider chartHyperlinkProvider, Graphics2D grx, Rectangle2D renderingArea, double dpiScale)
      Collects the hyperlink areas of a chart laid out on the given area. The areas come out in the coordinates the chart was laid out in, so they are scaled back to the pixels of the report.
    • getTheme

      public ChartTheme getTheme(String themeName)
    • drawChart

      public static void drawChart(org.jfree.chart.JFreeChart chart, Graphics2D grx, Rectangle2D rectangle, int reportDpi)
      Draws a chart at the resolution of the report. Charts lay themselves out using fonts and strokes expressed in points, so at a resolution other than the default they are drawn onto a surface scaled accordingly, on a rectangle reduced by the same amount.
    • toChartLength

      public static float toChartLength(float reportPixels, int reportDpi)
      Converts a length expressed in report pixels into the point based coordinates a chart lays out in, so that paints and shapes derived from the dimensions of the chart element line up with the chart itself.
    • toChartArea

      public static Rectangle2D toChartArea(Rectangle2D rectangle, double dpiScale)
      Reduces a rectangle expressed in report pixels to the point based area a chart lays out in.
    • getChartRenderableFactory

      public ChartRenderableFactory getChartRenderableFactory(String renderType)
    • createIntegerTickUnits

      public org.jfree.chart.axis.TickUnitSource createIntegerTickUnits(Locale locale)
    • createStandardTickUnits

      public org.jfree.chart.axis.TickUnitSource createStandardTickUnits(Locale locale)
    • setAutoTickUnit

      public void setAutoTickUnit(org.jfree.chart.axis.NumberAxis numberAxis)
    • getPlotOrientation

      public static final org.jfree.chart.plot.PlotOrientation getPlotOrientation(PlotOrientationEnum plotOrientationEnum)
    • getPlotOrientation

      public static final PlotOrientationEnum getPlotOrientation(org.jfree.chart.plot.PlotOrientation jfcPlotOrientation)
    • getScaleType

      public static final Integer getScaleType(ScaleTypeEnum scaleTypeEnum)
    • getTimePeriod

      public static final TimePeriodEnum getTimePeriod(Class<?> timePeriodClass)
    • getTimePeriod

      public static final Class<?> getTimePeriod(TimePeriodEnum timePeriod)