Interface ChartProvider

  • public interface ChartProvider
    Defines the interface for chart providers. A chart provider interfaces with the persistence store to get the data and receives parameters from the UI chart servlet and returns a chart image object (PNG).
    Chris Jackson - Initial contribution, Holger Reichert - Support for themes, DPI, legend hiding
    • Method Detail

      • getName

        String getName()
        Gets the name of this chart provider.
        String containing the provider name
      • createChart

        BufferedImage createChart​(String service,
                                  String theme,
                                  Date startTime,
                                  Date endTime,
                                  int height,
                                  int width,
                                  String items,
                                  String groups,
                                  Integer dpi,
                                  Boolean legend)
                           throws ItemNotFoundException
        Creates a chart object. This sets the initial parameters for the chart before the items are added
        service - A string containing the name of the persistence service. May be null in which case the chart provider can decide itself which store to use.
        theme - A string containing a theme name for the chart. The provider should store its own themes. May be null to use a default theme.
        startTime - The start time of the chart
        endTime - The end time of the chart
        height - The height of the chart
        width - The width of the chart
        items - The items to display on the chart
        groups - The groups to display on the chart
        dpi - The DPI (dots per inch) value, can be null
        legend - Show the legend? If null, the ChartProvider should make his own decision.
        BufferedImage object if the chart is rendered correctly, otherwise null.
        ItemNotFoundException - if an item or group is not found
        IllegalArgumentException - if an invalid argument is passed
      • getChartType

        ChartProvider.ImageType getChartType()
        Gets the type of data that will be written by the chart.