org.javasimon.utils
Class GoogleChartImageGenerator
java.lang.Object
org.javasimon.utils.GoogleChartImageGenerator
public final class GoogleChartImageGenerator
- extends Object
Produces URLs for Google Chart Image API - column type.
http://code.google.com/apis/chart/image/
- Author:
- Richard "Virgo" Richter
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FIXED_WIDTH
private static final int FIXED_WIDTH
- See Also:
- Constant Field Values
BAR_WIDTH
private static final int BAR_WIDTH
- See Also:
- Constant Field Values
BAR_SPACING
private static final int BAR_SPACING
- See Also:
- Constant Field Values
BAR_SPACING_MAX_MIN
private static final int BAR_SPACING_MAX_MIN
- See Also:
- Constant Field Values
IMAGE_HEIGHT
private static final int IMAGE_HEIGHT
- See Also:
- Constant Field Values
URL_START
private static final String URL_START
- See Also:
- Constant Field Values
TYPE_BAR1
private static final String TYPE_BAR1
- See Also:
- Constant Field Values
TYPE_BAR2
private static final String TYPE_BAR2
- See Also:
- Constant Field Values
NUMBER_FORMAT
private static final DecimalFormat NUMBER_FORMAT
REPLACERS
private static final List<Replacer> REPLACERS
TEN_BASE
private static final int TEN_BASE
- See Also:
- Constant Field Values
samples
private StopwatchSample[] samples
title
private String title
divisor
private double divisor
unit
private String unit
showMaxMin
private boolean showMaxMin
max
private double max
first
private boolean first
GoogleChartImageGenerator
private GoogleChartImageGenerator(StopwatchSample[] samples,
String title,
double divisor,
String unit,
boolean showMaxMin)
barChart
public static String barChart(StopwatchSample[] samples,
String title,
double divisor,
String unit,
boolean showMaxMin)
- Generates Google bar chart URL for the provided samples.
- Parameters:
samples - stopwatch samplestitle - chart titledivisor - value divisor. For example: if values are in ns and ms are required,
divisor should be set to 1000000.unit - unit shown after values under every barshowMaxMin - true if additional datasets for max and min values should be shown
- Returns:
- URL generating the bar chart
process
private String process()
addValueToAxis
private String addValueToAxis(StringBuilder axis,
double value)
encode
private static String encode(String s)
Copyright © 2013. All Rights Reserved.