Search in sources :

Example 1 with IntervalMarker

use of org.jfree.chart.plot.IntervalMarker in project pinot by linkedin.

the class AnomalyGraphGenerator method createGraphMarker.

/**
   * Returns either a value marker (point) or a interval marker (range) depending on provided
   * inputs. By default values are gray or transparent gray.
   * @param intervalStart
   * @param intervalEnd
   * @return
   */
private Marker createGraphMarker(Long intervalStart, Long intervalEnd, String label) {
    Marker anomalyMarker;
    if (intervalEnd == null || intervalStart.equals(intervalEnd)) {
        // Point
        anomalyMarker = new ValueMarker(intervalStart);
        anomalyMarker.setPaint(Color.LIGHT_GRAY);
    } else {
        // Range
        anomalyMarker = new IntervalMarker(intervalStart, intervalEnd);
        anomalyMarker.setPaint(TRANSPARENT_GRAY);
    }
    anomalyMarker.setLabel(label);
    LOG.info("Anomaly marker generated for: {}, {}", intervalStart, intervalEnd);
    return anomalyMarker;
}
Also used : IntervalMarker(org.jfree.chart.plot.IntervalMarker) ValueMarker(org.jfree.chart.plot.ValueMarker) Marker(org.jfree.chart.plot.Marker) IntervalMarker(org.jfree.chart.plot.IntervalMarker) ValueMarker(org.jfree.chart.plot.ValueMarker)

Aggregations

IntervalMarker (org.jfree.chart.plot.IntervalMarker)1 Marker (org.jfree.chart.plot.Marker)1 ValueMarker (org.jfree.chart.plot.ValueMarker)1