Annotation Interface GraphProvider


@Retention(RUNTIME) @Target(METHOD) public @interface GraphProvider
Defines a method that returns DataPoint.

METHODS ANNOTATED BY THIS WILL BE TREATED CASE INSENSITIVE (all lowercase) to store data in the database.

The DataSource returned by this will sampled at specific times, defined by sampleInterval() and sampleIntervalUnit().

DataPoint can have multiple values per x-axis value, to provide multiple series.

You have a lot of control over how the graph is displayed with the metadata returned by the DataSource and properties in this annotation.

Requires capability DATA_EXTENSION_GRAPH_API.

Does not support Conditional.

  • Element Details

    • displayName

      String displayName
      Name of the graph that is shown to users.
      Returns:
      "Version count history"
    • priority

      int priority
      Display-priority of the graph, highest value is placed top most.

      Two values with same priority may appear in a random order.

      Returns:
      Priority between 0 and Integer.MAX_VALUE.
      Default:
      0
    • iconName

      String iconName
      Name of Font Awesome icon.

      See FontAwesome (select 'free')) for icons and their Family.

      Returns:
      Name of the icon, if name is not valid no icon is shown.
      Default:
      "chart-line"
    • iconFamily

      Family iconFamily
      Family of Font Awesome icon.

      See FontAwesome (select 'free')) for icons and their Family.

      Returns:
      Family that matches an icon, if there is no icon for this family no icon is shown.
      Default:
      SOLID
    • iconColor

      Color iconColor
      Color preference of the plugin.

      This color will be set as the default color to use for plugin's elements.

      Returns:
      Preferred color. If none are specified defaults are used.
      Default:
      NONE
    • xAxisType

      XAxisType xAxisType
      Define what formatter to use for x-axis.
      Returns:
      by default XAxisType.DATE_MILLIS.
      Default:
      DATE_MILLIS
    • xAxisSoftMin

      int xAxisSoftMin
      Minimum for x-axis, growing if necessary.
      Returns:
      disabled by default (Int min value).
      Default:
      -2147483648
    • xAxisSoftMax

      int xAxisSoftMax
      Maximum for x-axis, growing if necessary.
      Returns:
      disabled by default (Int min value).
      Default:
      -2147483648
    • yAxisSoftMin

      int yAxisSoftMin
      Minimum for y-axis, growing if necessary.
      Returns:
      0 by default.
      Default:
      0
    • yAxisSoftMax

      int yAxisSoftMax
      Maximum for y-axis, growing if necessary.
      Returns:
      2 by default.
      Default:
      2
    • sampleInterval

      int sampleInterval
      How often this method should be called.

      For PlayerGraphDataSource minimum is 30 SECONDS. =120 points per hour per player, with 100 players =12000 points/hour

      Storage requirements can be calculated with (points per hour) * (players) * 64 * (2 + y) where y is amount of values returned with DataPoint. y=1: 120 * 100 * 64 * (2 + 1) = 2.3 MB of data/hour = 17.3 days to fill up 1 GB.

      Be considerate, try to aim for at least 30 days/1 GB.

      For ServerGraphDataSource minimum is 5 SECONDS. = 720 points per hour

      Recommended interval is 1 MINUTE or bigger, due to data storage size.

      Returns:
      by default returns 1.
      See Also:
      Default:
      1
    • sampleIntervalUnit

      TimeUnit sampleIntervalUnit
      How often this method should be called.
      Returns:
      by default returns TimeUnit.MINUTES.
      See Also:
      Default:
      MINUTES
    • supportsStacking

      boolean supportsStacking
      Should the values in the datapoint be stackable when graphed.

      This is useful if all values represent same kind of data.

      If ServerGraphDataSource.getSeriesMetadata() returns more than one unique unit name or format, this method will be ignored, since different units or valueFormats don't stack.

      Returns:
      false by default.
      Default:
      false
    • supportedAggregateFunctions

      Aggregates[] supportedAggregateFunctions
      Define any aggregate functions the value series supports.

      Automatic aggregate numbers (As if using NumberProvider) will be added to the same Tab if these are defined.

      Returns:
      None by default.
      Default:
      {}
    • strategy

      HistoryStrategy strategy
      Defines a HistoryStrategy the data will be appended to existing data.
      Returns:
      HistoryStrategy.NO_HISTORY by default.
      Default:
      NO_HISTORY