Package org.netxms.client.datacollection
Class ChartConfig
- java.lang.Object
-
- org.netxms.client.datacollection.ChartConfig
-
- Direct Known Subclasses:
GraphSettings
public class ChartConfig extends Object
Base class for all chart widget configs
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanareaprotected booleanautoRefreshprotected booleanautoScaleprotected ChartDciConfig[]dciListprotected booleanextendedLegendprotected intlegendPositionprotected intlineWidthprotected booleanlogScaleprotected doublemaxYScaleValueprotected doubleminYScaleValueprotected intrefreshRateprotected booleanshowGridprotected booleanshowHostNamesprotected booleanshowLegendprotected booleanshowTitleprotected booleanstackedprotected inttimeFrameTypeprotected DatetimeFromprotected inttimeRangeprotected DatetimeToprotected inttimeUnitsprotected Stringtitleprotected booleantranslucent
-
Constructor Summary
Constructors Constructor Description ChartConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(GraphSettingsChangeListener listener)Add change listenerstatic ChartConfigcreateFromXml(String xml)Create chart settings object from XML documentStringcreateXml()Create XML from configuration.voidfireChangeNotification()Fire change notificationChartDciConfig[]getDciList()intgetLegendPosition()intgetLineWidth()doublegetMaxYScaleValue()doublegetMinYScaleValue()intgetRefreshRate()intgetTimeFrameType()DategetTimeFrom()intgetTimeRange()longgetTimeRangeMillis()Get time range covered by graph in millisecondsDategetTimeTo()intgetTimeUnits()StringgetTitle()booleanisArea()booleanisAutoRefresh()booleanisAutoScale()booleanisExtendedLegend()booleanisLogScale()booleanisShowGrid()booleanisShowHostNames()booleanisShowLegend()booleanisShowTitle()booleanisStacked()booleanisTranslucent()booleanisUseMultipliers()booleanmodifyYBase()Modify Y basevoidremoveChangeListener(GraphSettingsChangeListener listener)Remove change listenervoidsetArea(boolean area)voidsetAutoRefresh(boolean autoRefresh)voidsetAutoScale(boolean autoScale)voidsetConfig(ChartConfig config)voidsetDciList(ChartDciConfig[] dciList)voidsetExtendedLegend(boolean extendedLegend)voidsetLegendPosition(int legendPosition)voidsetLineWidth(int lineWidth)voidsetLogScale(boolean logScale)voidsetMaxYScaleValue(double maxYScaleValue)voidsetMinYScaleValue(double minYScaleValue)voidsetModifyYBase(boolean modifyYBase)Set modify Y basevoidsetRefreshRate(int refreshRate)voidsetShowGrid(boolean showGrid)voidsetShowHostNames(boolean showHostNames)voidsetShowLegend(boolean showLegend)voidsetShowTitle(boolean showTitle)voidsetStacked(boolean stacked)voidsetTimeFrameType(int timeFrameType)voidsetTimeFrom(Date timeFrom)voidsetTimePeriod(TimePeriod tp)voidsetTimeRange(int timeRange)voidsetTimeTo(Date timeTo)voidsetTimeUnits(int timeUnits)voidsetTitle(String title)voidsetTranslucent(boolean translucent)voidsetUseMultipliers(boolean useMultipliers)TimePeriodtimePeriod()
-
-
-
Field Detail
-
dciList
protected ChartDciConfig[] dciList
-
title
protected String title
-
legendPosition
protected int legendPosition
-
showLegend
protected boolean showLegend
-
extendedLegend
protected boolean extendedLegend
-
showTitle
protected boolean showTitle
-
showGrid
protected boolean showGrid
-
showHostNames
protected boolean showHostNames
-
autoRefresh
protected boolean autoRefresh
-
logScale
protected boolean logScale
-
stacked
protected boolean stacked
-
translucent
protected boolean translucent
-
area
protected boolean area
-
lineWidth
protected int lineWidth
-
autoScale
protected boolean autoScale
-
minYScaleValue
protected double minYScaleValue
-
maxYScaleValue
protected double maxYScaleValue
-
refreshRate
protected int refreshRate
-
timeUnits
protected int timeUnits
-
timeRange
protected int timeRange
-
timeFrameType
protected int timeFrameType
-
timeFrom
protected Date timeFrom
-
timeTo
protected Date timeTo
-
-
Method Detail
-
createFromXml
public static ChartConfig createFromXml(String xml) throws Exception
Create chart settings object from XML document- Parameters:
xml- XML document- Returns:
- deserialized object
- Throws:
Exception- if the object cannot be fully deserialized
-
createXml
public String createXml() throws Exception
Create XML from configuration.- Returns:
- XML document
- Throws:
Exception- if the schema for the object is not valid
-
getTimeRangeMillis
public long getTimeRangeMillis()
Get time range covered by graph in milliseconds- Returns:
- The time range
-
getTitle
public String getTitle()
- Returns:
- the title
-
setTitle
public void setTitle(String title)
- Parameters:
title- the title to set
-
getDciList
public ChartDciConfig[] getDciList()
- Returns:
- the dciList
-
setDciList
public void setDciList(ChartDciConfig[] dciList)
- Parameters:
dciList- the dciList to set
-
getLegendPosition
public int getLegendPosition()
- Returns:
- the legendPosition
-
setLegendPosition
public void setLegendPosition(int legendPosition)
- Parameters:
legendPosition- the legendPosition to set
-
isShowLegend
public boolean isShowLegend()
- Returns:
- the showLegend
-
setShowLegend
public void setShowLegend(boolean showLegend)
- Parameters:
showLegend- the showLegend to set
-
getRefreshRate
public int getRefreshRate()
- Returns:
- the refreshRate
-
setRefreshRate
public void setRefreshRate(int refreshRate)
- Parameters:
refreshRate- the refreshRate to set
-
isShowTitle
public boolean isShowTitle()
- Returns:
- the showTitle
-
setShowTitle
public void setShowTitle(boolean showTitle)
- Parameters:
showTitle- the showTitle to set
-
getTimeUnits
public int getTimeUnits()
- Returns:
- the timeUnits
-
setTimeUnits
public void setTimeUnits(int timeUnits)
- Parameters:
timeUnits- the timeUnits to set
-
getTimeRange
public int getTimeRange()
- Returns:
- the timeRange
-
setTimeRange
public void setTimeRange(int timeRange)
- Parameters:
timeRange- the timeRange to set
-
isShowHostNames
public boolean isShowHostNames()
- Returns:
- the showHostNames
-
setShowHostNames
public void setShowHostNames(boolean showHostNames)
- Parameters:
showHostNames- the showHostNames to set
-
isAutoRefresh
public boolean isAutoRefresh()
- Returns:
- the autoRefresh
-
setAutoRefresh
public void setAutoRefresh(boolean autoRefresh)
- Parameters:
autoRefresh- the autoRefresh to set
-
isLogScale
public boolean isLogScale()
- Returns:
- the logScale
-
setLogScale
public void setLogScale(boolean logScale)
- Parameters:
logScale- the logScale to set
-
getTimeFrameType
public int getTimeFrameType()
- Returns:
- the timeFrameType
-
setTimeFrameType
public void setTimeFrameType(int timeFrameType)
- Parameters:
timeFrameType- the timeFrameType to set
-
getTimeFrom
public Date getTimeFrom()
- Returns:
- the timeFrom
-
setTimeFrom
public void setTimeFrom(Date timeFrom)
- Parameters:
timeFrom- the timeFrom to set
-
getTimeTo
public Date getTimeTo()
- Returns:
- the timeTo
-
setTimeTo
public void setTimeTo(Date timeTo)
- Parameters:
timeTo- the timeTo to set
-
isShowGrid
public boolean isShowGrid()
- Returns:
- the showGrid
-
setShowGrid
public void setShowGrid(boolean showGrid)
- Parameters:
showGrid- the showGrid to set
-
isStacked
public boolean isStacked()
- Returns:
- the stacked
-
setStacked
public void setStacked(boolean stacked)
- Parameters:
stacked- the stacked to set
-
isTranslucent
public boolean isTranslucent()
- Returns:
- the translucent
-
setTranslucent
public void setTranslucent(boolean translucent)
- Parameters:
translucent- the translucent to set
-
isExtendedLegend
public boolean isExtendedLegend()
- Returns:
- the extendedLegend
-
setExtendedLegend
public void setExtendedLegend(boolean extendedLegend)
- Parameters:
extendedLegend- the extendedLegend to set
-
getLineWidth
public int getLineWidth()
- Returns:
- the lineWidth
-
setLineWidth
public void setLineWidth(int lineWidth)
- Parameters:
lineWidth- the lineWidth to set
-
isAutoScale
public boolean isAutoScale()
- Returns:
- true if auto scale is set
-
setAutoScale
public void setAutoScale(boolean autoScale)
- Parameters:
autoScale- Set auto scale
-
isArea
public boolean isArea()
- Returns:
- the area
-
setArea
public void setArea(boolean area)
- Parameters:
area- the area to set
-
getMinYScaleValue
public double getMinYScaleValue()
- Returns:
- Minimal Y scale
-
setMinYScaleValue
public void setMinYScaleValue(double minYScaleValue)
- Parameters:
minYScaleValue- The scale value to set
-
getMaxYScaleValue
public double getMaxYScaleValue()
- Returns:
- Max Y scale
-
setMaxYScaleValue
public void setMaxYScaleValue(double maxYScaleValue)
- Parameters:
maxYScaleValue- max Y scale
-
timePeriod
public TimePeriod timePeriod()
- Returns:
- The time period
-
setTimePeriod
public void setTimePeriod(TimePeriod tp)
- Parameters:
tp- The time period to set
-
addChangeListener
public void addChangeListener(GraphSettingsChangeListener listener)
Add change listener- Parameters:
listener- change listener
-
removeChangeListener
public void removeChangeListener(GraphSettingsChangeListener listener)
Remove change listener- Parameters:
listener- change listener to remove
-
fireChangeNotification
public void fireChangeNotification()
Fire change notification
-
setModifyYBase
public void setModifyYBase(boolean modifyYBase)
Set modify Y base- Parameters:
modifyYBase- if true, use min DCI value as Y base
-
modifyYBase
public boolean modifyYBase()
Modify Y base- Returns:
- true if use min DCI value as Y base
-
setConfig
public void setConfig(ChartConfig config)
-
isUseMultipliers
public boolean isUseMultipliers()
- Returns:
- the useMultipliers
-
setUseMultipliers
public void setUseMultipliers(boolean useMultipliers)
- Parameters:
useMultipliers- the useMultipliers to set
-
-