public class ChartUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
chartTypeBar |
static java.lang.String |
chartTypeDial |
static java.lang.String |
chartTypePie |
static java.lang.String |
chartTypeTrend |
Constructor and Description |
---|
ChartUtil() |
Modifier and Type | Method and Description |
---|---|
java.util.Vector |
computeTics(double minVal,
double maxVal,
int maxTicks,
double step)
This method takes axis range parameters and produces a list of string
representations of rounded numbers within the given range.
|
java.awt.Color |
decodeColor(java.lang.String hexValue)
Decodes color based ona hex value
|
java.lang.String |
formatNum(double number,
int numfracdigits)
Return a string for displaying the specified number
using the specified number of digits after the decimal point.
|
java.lang.String |
formatNumber(double dNumber,
java.util.Locale userLocale)
Format the number to make it upto 2 decimal places in fraction and remove trailing zeros
|
java.lang.String |
getChartFont(WebClientSession sc)
Returns the font to be used in the graph from the resource file
|
static ChartUtil |
getChartUtil()
Returns the static instance of this class.
|
java.lang.String |
getDefaultColor()
Get default color
|
java.util.Properties |
getKPIChartColors(WebClientSession wcs)
Returns a property set as a colors to be used in KPI dial and bar chart
|
java.lang.String[] |
getKPITrendChartColors(WebClientSession wcs)
Returns string array of colors to be used in KPI trend chart
|
java.lang.String[] |
getResultSetChartColors(WebClientSession wcs)
Returns string array of colors to be used in KPI trend chart
|
void |
loadChartPropertiesDOM()
Reads from chartpropreties configuration file and for every chart type loads color info.
|
double |
log(double value,
int base)
Returns log for a given base
|
java.lang.String |
makeColorTableString(java.lang.String[] colorTable)
Makes color table string for CDL inside the class
|
int |
numberOfDigits(double value,
java.util.Locale userLocale)
Returns number of integer digits in a number
|
int |
numFracDigits(double number)
Return the number of fractional digits required to display the
given number.
|
double |
roundDown(double val) |
double |
roundUp(double val)
Given a number, round up to the nearest power of ten
times 1, 2, or 5.
|
double |
roundUpWithLog(double val)
Given a number, round up to the nearest power of ten
times 1, 2, or 5.
|
double |
tic(double minVal,
double maxVal,
int maxTicks)
Return the Tic step calculated dynamically
|
public static final java.lang.String chartTypeTrend
public static final java.lang.String chartTypeDial
public static final java.lang.String chartTypeBar
public static final java.lang.String chartTypePie
public double roundUp(double val)
val
- Value to be roundedpublic double roundUpWithLog(double val)
val
- Value to be roundedpublic double roundDown(double val)
public double log(double value, int base)
double
- - Value to get log ofint
- - base of the logpublic java.lang.String formatNum(double number, int numfracdigits)
double
- - Number to formatint
- - Digits after decimal pointpublic int numFracDigits(double number)
double
- - Number to find the fractions inpublic java.util.Vector computeTics(double minVal, double maxVal, int maxTicks, double step)
double
- - no tics will be created for less than this value.double
- - maxVal no tics will be created for greater than this value.int
- - returned vector will contain no more labels than this number.double
- - step value between ticspublic double tic(double minVal, double maxVal, int maxTicks)
double
- - no tics will be created for less than this value.double
- - no tics will be created for greater than this value.int
- - returned vector that will contain no more labels than this number.public java.lang.String getChartFont(WebClientSession sc)
public int numberOfDigits(double value, java.util.Locale userLocale)
double
- - number in which digits have to be countedpublic java.lang.String[] getKPITrendChartColors(WebClientSession wcs)
wcs
- Webclientsessionpublic java.util.Properties getKPIChartColors(WebClientSession wcs)
wcs
- Webclientsessionpublic java.lang.String[] getResultSetChartColors(WebClientSession wcs)
wcs
- Webclientsessionpublic static ChartUtil getChartUtil()
public void loadChartPropertiesDOM()
public java.awt.Color decodeColor(java.lang.String hexValue)
hexValue
- Stringpublic java.lang.String makeColorTableString(java.lang.String[] colorTable)
colorTable
- as String[]public java.lang.String getDefaultColor()
public java.lang.String formatNumber(double dNumber, java.util.Locale userLocale)
dNumber
- double to perform function on