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).
    Author:
    Chris Jackson - Initial contribution
    • Method Detail

      • getName

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

        BufferedImage createChart​(String service,
                                  String theme,
                                  Date startTime,
                                  Date endTime,
                                  int height,
                                  int width,
                                  String items,
                                  String groups)
                           throws ItemNotFoundException
        Creates a chart object. This sets the initial parameters for the chart before the items are added
        Parameters:
        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.
        widget - The widget ID. This allows the chart provider to look up the widget and get the items directly from the sitemap definition. May be null.
        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.
        height - The height of the chart.
        width - The width of the chart.
        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
        Returns:
        BufferedImage object if the chart is rendered correctly, otherwise null.
        Throws:
        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.
        Returns:
        ImageType