LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.jquery.component.chart
Class LyJQChart

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.jquery.component.LyJQInternalView
              extended by leon.view.web.jquery.component.fieldItem.LyJQFieldItem
                  extended by leon.view.web.jquery.component.panel.LyJQPanel
                      extended by leon.view.web.jquery.component.chart.LyJQChart
All Implemented Interfaces:
LyGetChartConverterInterface, LyGraphicalChart, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetBoundsInterface, LySetLabelInterface, LySetPopupMenuInterface, LyWebComponent

public class LyJQChart
extends LyJQPanel
implements LyGraphicalChart, LyGetChartConverterInterface, LySetBoundsInterface

Type : leon.view.web.jquery.component.chart The peer component of LyTab for the web2 viewer.


Field Summary
static java.lang.String[] DEFAULT_COLORS
          Default colors used for charts.
static int PIE_LABEL_MAX_LENGTH
          Max length for labels displayed in pie charts.
 
Fields inherited from class leon.view.web.jquery.component.fieldItem.LyJQFieldItem
__VERSION
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Fields inherited from interface leon.view.graphic.LyGraphicalChart
__VERSION
 
Fields inherited from interface leon.view.getinterface.LyGetChartConverterInterface
__VERSION
 
Fields inherited from interface leon.view.setinterface.LySetBoundsInterface
__VERSION
 
Fields inherited from interface leon.view.setinterface.LySetPopupMenuInterface
__VERSION
 
Constructor Summary
LyJQChart(LyChart chart)
          Constructor
 
Method Summary
 void addColumn(LyColumn columns, int pos)
          Inserts a sub-component columns at given position.
 java.lang.String addLabelCR(java.lang.String label)
          Adds carriage returns in a label in order to shorten its length.
 void free()
          Free resources allocated to this component.
 java.lang.String generateChartImage()
          generate chart image.
 LyJQChartConverter getChartConverter()
          Get the Chart Converter (if any).
 java.lang.String[] getColors()
          Returns the colors that must be used by chart component.
 int[] getComponentDimension()
          Get the dimension of the component used to represent the chart.
 int getHeight()
          Returns the height of the chart that must be displayed.
 java.lang.String getHtmlLink(java.lang.String imagePath)
          Gets the HTML tag that links the image to the ressource.
 int getLastIndex()
           
 java.lang.String getPieValueLabel(java.lang.String label, java.lang.String value, LyColumn column)
          Returns the label to be displayed for a section of a pie chart.
 int getWidth()
          Returns the width of the chart that must be displayed.
 void initialize()
          Initialization method.
 boolean isChart()
           
 boolean isInPopup()
          Indicates whether this chart is in a popup view.
 void removeColumn(LyColumn columns)
          Removes a sub-component columns.
 void saveChartFile(java.lang.String tmpDir, java.lang.String imageFile, java.lang.StringBuffer buffer)
          Save the file to the http directory.
 void setContent()
          Sets the content of this view.
 void setLocation(int x, int y)
          Accessor to the location.
 void setSize(int w, int h)
          Accessor to the Size.
 void writeHtml(LyWebPageWriter pw)
          Write HTML description corresponding to this component.
 java.lang.String xFormatDate(LyChartValue cv, LyChart c)
          Format date of x value
 float yMax()
          Get Max value of the column
 float yMin()
          Get Min value of the column
 int yStep()
          Get step for y axis
 float ySumMax()
          Get Sum max value of the columns
 
Methods inherited from class leon.view.web.jquery.component.panel.LyJQPanel
isChart, isForm, isGantt, isMap, isNotice, isPanel, isTable, isTree, setPopupMenu
 
Methods inherited from class leon.view.web.jquery.component.fieldItem.LyJQFieldItem
canDisabled, getCaption, getController, getFieldItem, getForm, getFormField, getReloadScript, getTarget, isEditable, isEnabled, isLabelInstance, isMail, isNetscape, isOptional, isPrintMode, isUrl, isUrlRecurse, needCheck, setLabel
 
Methods inherited from class leon.view.web.jquery.component.LyJQInternalView
getConvertedHTML, getEncoding, getId, getJavascriptStrId, getJSWithoutTranslateString, getTreatedInternalId, isIE, setProperty
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, refresh, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

PIE_LABEL_MAX_LENGTH

public static int PIE_LABEL_MAX_LENGTH
Max length for labels displayed in pie charts.


DEFAULT_COLORS

public static java.lang.String[] DEFAULT_COLORS
Default colors used for charts.

Constructor Detail

LyJQChart

public LyJQChart(LyChart chart)
Constructor

Parameters:
chart -
Method Detail

initialize

public void initialize()
Initialization method.


getLastIndex

public int getLastIndex()

generateChartImage

public java.lang.String generateChartImage()
generate chart image.


saveChartFile

public void saveChartFile(java.lang.String tmpDir,
                          java.lang.String imageFile,
                          java.lang.StringBuffer buffer)
Save the file to the http directory.

Parameters:
tmpDir - temporary directory for the image/svg
imageFile - name of the file
buffer - the buffer where imagemap must be generated

getHtmlLink

public java.lang.String getHtmlLink(java.lang.String imagePath)
Gets the HTML tag that links the image to the ressource.

Parameters:
imagePath - the image path
Returns:
the HTML tag for the image

setContent

public void setContent()
Sets the content of this view.


yMax

public float yMax()
Get Max value of the column

Returns:
float Max value

ySumMax

public float ySumMax()
Get Sum max value of the columns

Returns:
float Max value

yStep

public int yStep()
Get step for y axis

Returns:
int step

xFormatDate

public java.lang.String xFormatDate(LyChartValue cv,
                                    LyChart c)
Format date of x value

Parameters:
LyChartValue - cv, LyChart c
Returns:
string formated date

addLabelCR

public java.lang.String addLabelCR(java.lang.String label)
Adds carriage returns in a label in order to shorten its length.


getPieValueLabel

public java.lang.String getPieValueLabel(java.lang.String label,
                                         java.lang.String value,
                                         LyColumn column)
Returns the label to be displayed for a section of a pie chart.

Parameters:
label - the label of the pie section
value - the value of the pie section
column - the column containing the value

yMin

public float yMin()
Get Min value of the column

Returns:
float Min value

getWidth

public int getWidth()
Returns the width of the chart that must be displayed.


getHeight

public int getHeight()
Returns the height of the chart that must be displayed.


isInPopup

public boolean isInPopup()
Indicates whether this chart is in a popup view.


getColors

public java.lang.String[] getColors()
Returns the colors that must be used by chart component.


free

public void free()
Description copied from class: LyGraphicalObject
Free resources allocated to this component.

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyWebObject
See Also:
LyFreeInterface.free()

setLocation

public void setLocation(int x,
                        int y)
Description copied from interface: LySetBoundsInterface
Accessor to the location.

Specified by:
setLocation in interface LySetBoundsInterface
See Also:
LySetBoundsInterface.setLocation(int, int)

setSize

public void setSize(int w,
                    int h)
Description copied from interface: LySetBoundsInterface
Accessor to the Size.

Specified by:
setSize in interface LySetBoundsInterface
See Also:
LySetBoundsInterface.setSize(int, int)

getChartConverter

public LyJQChartConverter getChartConverter()
Description copied from interface: LyGetChartConverterInterface
Get the Chart Converter (if any).

Specified by:
getChartConverter in interface LyGetChartConverterInterface
Returns:
the graphical chart Converter.

getComponentDimension

public int[] getComponentDimension()
Description copied from interface: LyGetChartConverterInterface
Get the dimension of the component used to represent the chart.

Specified by:
getComponentDimension in interface LyGetChartConverterInterface
Returns:
an array of two integers (width and height of the component).

addColumn

public void addColumn(LyColumn columns,
                      int pos)
Description copied from interface: LyGraphicalChart
Inserts a sub-component columns at given position.

Specified by:
addColumn in interface LyGraphicalChart
Parameters:
columns - The columns to add to columns list.
pos - Position where the sub-component is inserted.

removeColumn

public void removeColumn(LyColumn columns)
Description copied from interface: LyGraphicalChart
Removes a sub-component columns.

Specified by:
removeColumn in interface LyGraphicalChart
Parameters:
columns - The columns to remove to columns list.

isChart

public boolean isChart()

writeHtml

public void writeHtml(LyWebPageWriter pw)
Description copied from interface: LyWebComponent
Write HTML description corresponding to this component.

Specified by:
writeHtml in interface LyWebComponent
Overrides:
writeHtml in class LyJQFieldItem
Parameters:
pw - the page writer

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com