public class SparklineGraph extends Object
Class for drawing sparkline graphics.
Drawing settings are controlled with SparklineParameters class
Use SparklineComponent class to easily include interactive sparklines in your GUI
SparklineParameters| Modifier and Type | Class and Description |
|---|---|
private static class |
SparklineGraph.HighlightParameters |
| Modifier and Type | Field and Description |
|---|---|
private static int |
HIGHLIGHT_RADIUS |
| Constructor and Description |
|---|
SparklineGraph() |
| Modifier and Type | Method and Description |
|---|---|
private static String |
buildHighlightText(SparklineParameters.HighlightTextMode highlightTextMode,
Number x,
Number y) |
private static float |
calculateMax(Number[] yValues) |
private static float |
calculateMin(Number[] yValues) |
static BufferedImage |
draw(Number[] xValues,
Number[] yValues,
Number yMinValue,
Number yMaxValue,
SparklineParameters parameters)
Draw a sparkline with x axis and y axis values, and pre-calculated min and max of the y axis values.
|
static BufferedImage |
draw(Number[] xValues,
Number[] yValues,
SparklineParameters parameters)
Draw a sparkline with x axis and y axis values.
|
static BufferedImage |
draw(Number[] yValues,
Number yMinValue,
Number yMaxValue,
SparklineParameters parameters)
Draw a sparkline only providing y axis values, and pre-calculated min and max of the y axis values.
|
static BufferedImage |
draw(Number[] values,
SparklineParameters parameters)
Draw a sparkline only providing y axis values (1 x tick per number assumed)
|
private static void |
drawHighlight(Graphics2D g,
float x,
float y,
Color highlightColor) |
private static final int HIGHLIGHT_RADIUS
public static BufferedImage draw(Number[] values, SparklineParameters parameters)
values - Y axis valuesparameters - Rendering parameterspublic static BufferedImage draw(Number[] xValues, Number[] yValues, SparklineParameters parameters)
xValues - X axis valuesyValues - Y axis valuesparameters - Rendering parameterspublic static BufferedImage draw(Number[] yValues, Number yMinValue, Number yMaxValue, SparklineParameters parameters)
SparklineGraphyValues - Y axis valuesyMinValue - Minimum value of the Y axis, should be correctyMaxValue - Maximum value of the Y axis, should be correctparameters - Rendering parameterspublic static BufferedImage draw(Number[] xValues, Number[] yValues, Number yMinValue, Number yMaxValue, SparklineParameters parameters)
SparklineGraph X values must be ordered and not repeated.xValues - X axis valuesyValues - Y axis valuesyMinValue - Minimum value of the Y axis, should be correctyMaxValue - Maximum value of the Y axis, should be correctparameters - Rendering parametersprivate static void drawHighlight(Graphics2D g, float x, float y, Color highlightColor)
private static float calculateMin(Number[] yValues)
private static float calculateMax(Number[] yValues)
private static String buildHighlightText(SparklineParameters.HighlightTextMode highlightTextMode, Number x, Number y)
Copyright © 2007–2017 Gephi Consortium. All rights reserved.