PropertyEventMethodIndex
WebSquare.uiplugin.chart - 5.0_4.4547B.20211124.201933

Chart. Renders a chart from the XML data. Generates various types of charts. The type property allows the developer to choose the chart type. Supported chart types include ColumnChart, BarChart, LineChart, RadialChart, and PieChart. Supports 22 types including ColumnChart, BarChart, LineChart, RadialChart, PieChart and 3D charts. Supports double charts in which two types are charts are applied. Using FusionChart instead of Chart is recommended for the mobile environment.
The <div> tag of HTML is used at the top level under which various other tags are used.

Type

uiplugin

Property Summary

axis3dBackgroundColor
Color code (in string format) of X and Y axes background in case of the 3D chart
axis3dBorderColor
Color code (in string format) of X and Y borders of the 3D chart
backgroundBorderColor
Color of the background border
backgroundBorderWidth
Width of the background border
backgroundGradient
[default:true, false] Use of the gradation effect on the background
bgColorPalette
[default:#ECEDED #FFFFFF] Colors for even and odd columns of the background grid (or guideline)
dataAxisChanged
[default:false, true] Combines the series based on the data.
displayFormat
Display format to be applied to the chart labels.
displayFormatter
Name of the customized display formatter for the chart
displayXAxis
[default:true, false] Displays the label of the X axis.
displayYAxis
[default:true, false] Displays the label of the Y axis.
elementTitle
Current value of the HTML title property.
fitGuidLine
[default:false, true] Tightly fits the number of the guidelines. (There will be no extra guidelines.)
gradientColorPalette
[default:#d8dfe0 #fafdfe] Gradation-starting and ending color values.
guidLineStyle
Style of the guideline
id
Component ID
labelData
[default:false, true] Includes the data names (labelNode values)in the chart labels.
labelNode
Column ID or XPath of the chart data label
labelPerValue
Includes the series percentage in the chart labels when the chart data is muliti.
labelSeparator
Separator between the values in the chart labels
labelSeries
Includes the series names in the chart labels.
labelValue
Includes the values in the chart labels.
lineStyle
Style of the guideline // (Example) border-width:2px</xmp>
mainGrid
Shows the main grid guideline.
mainGridLineOnly
Displays only the main grid guidelines (on a transparent background.)
maxYAxis
Maximum value on the Y axis
minYAxis
Minimum value on the Y axis
ref
Path to the DataCollection to bind the data.
rootNode
XPath of the chart data in XML
roundRectangle
Use of the rounded rectangle background
seriesBorderColor
Color codes of each of the series borders
seriesBorderWidth
Widths of each of the series of the chart
seriesColor
Color codes of each of the series on the chart. Use blank space to separate each color code.
seriesPosition
Position to display the series
seriesShow
Shows the series.
seriesSymbol
Color codes of each of the series symbols on the chart. "square" "circle" "triangle-down" "diamond" "triangle-down"</xmp>
subGrid
Displays the sub grid guidelines.
tabIndex
The focusing order by the Tab key.
tableDisplayFormat
Table displaying format
tableDisplayFormatter
Name of the customized table display formatter function
tableShow
Displays the data table of the chart.
title
Same as the class property in HTML.
titlePosition
Value of the position property in the CSS for the chart title
titleShow
Displays the chart title.
titleStyle
Style of the chart title
tooltip
Text to be displayed upon the end user’s hovering the mouse over the component.
tooltipLocaleRef
Text key of the tooltip in case the tooltip text is provided in multiple languages.
type
Type of the chart
usePopup
Uses the popup.
valueType
Type of the chart value
xAxisTitle
Title of the X axis
xAxisTitleShow
Shows the title of the X axis.
xAxisTitleStyle
Style of the X axis
y1AxisTitle
Title of Y axis
y1AxisTitleShow
Shows the title of the Y axis
y1AxisTitleStyle
Style of the Y axis
y1DisplayFormat
Y-axis displaying format
y1DisplayFormatter
Name of the customized Y-axis display formatter
y2DisplayFormat
Y-axis display format for the double chart
y2DisplayFormatter
Name of the customized Y-axis display formatter for the double chart

Event Summary

Method Summary

addClass( className )
Adds a CSS class to the component.
appendXML( data , maxCount , modify )
Appends the received XML data to the existing data.
applySeriesConfig( useDoubleChart , seriesUseChk , seriesAxisChk , chartType , chartType )
Sets the series-related configuration for the chart.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component.
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
deleteData( )
Deletes the chart data.
excelDownload( options )
Downloads the chart data as an Excel file.
focus( )
Focuses the WebSquare component.
getDataListInfo( )
Returns the dataList bound with the component.
getDisabled( )
Returns the current value of the disabled property.
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself.
getID( )
Returns the ID of the WebSquare component.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
getPluginName( )
Returns the name of the WebSquare component.
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
getReadOnly( )
Returns the current value of the readOnly property.
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
getStyle( propertyName )
Returns the CSS setting of the WebSquare component.
getStyleValue( style )
[deprecated]
getTitle( )
Returns the title of the WebSquare component.
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file.
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
redraw( )
Redraws the chart.
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
setAccessibility( flag )
Supports the web accessibility to the WebSquare5 charts.
setChartType( chartType )
Changes the type of the chart.
setDataCollection( dataList , labelId , append , modify )
Sets the data of the specified DataCollection to the chart.
setDisabled( disabled )
Sets the disabled property of the WebSquare component.
setEventPause( evList , flag )
Pauses the event.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setMaxYAxis( maxYaxis )
Sets the maximum value of the Y axis, and displays it.
setMinYAxis( minYaxis )
Sets the minimum value of the Y axis, and displays it.
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component.
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component.
setSeriesAxis( seriesAxisChk )
Sets the series for the drawing layer of the chart.
setSize( width , height )
Sets the size of the chart.
setTitle( title )
Sets the title of the WebSquare component.
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
setValue( value , seriesIndex , dataIndex )
Sets the received seriesIndex or dataIndex as the value.
setXML( data , append , modify )
Sets the XML data in the chart.
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
trigger( type , array )
Triggers the specified event in the WebSquare component.
unbind( type , function )
Removes the specified event from the WebSquare component.
visible( flag )
[deprecated]

Property Detail

axis3dBackgroundColor
Color code (in string format) of X and Y axes background in case of the 3D chart
axis3dBorderColor
Color code (in string format) of X and Y borders of the 3D chart
backgroundBorderColor
Color of the background border
backgroundBorderWidth
Width of the background border
backgroundGradient
[default:true, false] Use of the gradation effect on the background
bgColorPalette
[default:#ECEDED #FFFFFF] Colors for even and odd columns of the background grid (or guideline)
ex) MistyRose #fff
dataAxisChanged
[default:false, true] Combines the series based on the data.
Displays the X axis based on the data. / Changes the axis of the data.
displayFormat
Display format to be applied to the chart labels.
displayFormatter
Name of the customized display formatter for the chart
displayXAxis
[default:true, false] Displays the label of the X axis.
displayYAxis
[default:true, false] Displays the label of the Y axis.
elementTitle
Current value of the HTML title property.
"$blank" is for an empty string.
fitGuidLine
[default:false, true] Tightly fits the number of the guidelines. (There will be no extra guidelines.)
gradientColorPalette
[default:#d8dfe0 #fafdfe] Gradation-starting and ending color values.
When the backgroundGradient is false, the gradation-starting value (or the fist value) will be used as the background color.
guidLineStyle
Style of the guideline (Example) border-width:2px;border-color:green;
id
Component ID
The component ID is allocated as a global object. The script can access each object through the component ID.
labelData
[default:false, true] Includes the data names (labelNode values)in the chart labels.
(Example)) "Jan, 1000" : Data is "1000", and the value of the labelNode property is "Jan".
labelNode
Column ID or XPath of the chart data label. Mandatory to draw a chart.
labelPerValue
Includes the series percentage in the chart labels when the chart data is muliti.
labelSeparator
Separator between the values in the chart labels
labelSeries
Includes the series names in the chart labels.
labelValue
Includes the values in the chart labels.
lineStyle
Style of the guideline // (Example) border-width:2px
mainGrid
Shows the main grid guideline.
mainGridLineOnly
Displays only the main grid guidelines (on a transparent background.)
maxYAxis
Maximum value on the Y axis
minYAxis
Minimum value on the Y axis
ref
ath to the DataCollection to bind the data. Used with the labelNode.
rootNode
XPath of the chart data in XML
roundRectangle
Use of the rounded rectangle background
seriesBorderColor
Color codes of each of the series borders
seriesBorderWidth
Widths of each of the series of the chart
seriesColor
Color codes of each of the series on the chart. Use blank space to separate each color code.
seriesPosition
Position to display the series
seriesShow
Shows the series.
seriesSymbol
Color codes of each of the series symbols on the chart. "square" "circle" "triangle-down" "diamond" "triangle-down"
subGrid
Displays the sub grid guidelines.
tabIndex
The focusing order by the Tab key.
Same as the tabindex property in HTML.
tableDisplayFormat
Table displaying format
tableDisplayFormatter
Name of the customized table display formatter function
tableShow
Displays the data table of the chart.
title
Same as the title property in HTML. The title is displayed upon the end user’s moving the mouse over the component. Generally used to support web accessibility.
titlePosition
Value of the position property in the CSS for the chart title
titleShow
Displays the chart title.
titleStyle
Style of the chart title
tooltip
Text to be displayed upon the end user’s hovering the mouse over the component. Provided by WebSquare, and specifies additional information of the component.
tooltipLocaleRef
Text key of the tooltip in case the tooltip text is provided in multiple languages.
When there is no text for the key, "global_undefined" will be displayed on the screen.
type
Type of the chart
usePopup
Uses the popup.
valueType
Type of the chart value
xAxisTitle
Title of the X axis
xAxisTitleShow
Shows the title of the X axis.
xAxisTitleStyle
Style of the X axis
y1AxisTitle
Title of Y axis
y1AxisTitleShow
Shows the title of the Y axis
y1AxisTitleStyle
Style of the Y axis
y1DisplayFormat
Y-axis displaying format
y1DisplayFormatter
Name of the customized Y-axis display formatter
y2DisplayFormat
Y-axis display format for the double chart
y2DisplayFormatter
Name of the customized Y-axis display formatter for the double chart

Event Detail

Method Detail

addClass( className )
Adds a CSS class to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// (Example) // Add oddClass to input1 component. input1.addClass("oddClass");
appendXML( data , maxCount , modify )
Appends the received XML data to the existing data.
Parameter
nametyperequireddescription
dataXML DocumentYXML document for the chart
<currentWork> <series> <label value="방송"/> <label value="영화"/> <label value="도서"/> </series> <data key="0"> <label value="2011"/> <value key="0" value="10"/> <value key="1" value="200"/> <value key="2" value="30"/> </data> </currentWork>
maxCountNumberNMaximum number of the data items to show. If the maxCount is larger than the chart data items (existing + appended items), the entire data items will be drawn. If the maxCount is smaller than the chart data items, only the upper data as many as the maxCount will be drawn.
modifyBooleanNModification status. The default is false. When this value is true, the data will be read again from the model and the data layer of the chart will be drawn again. In case of false, the entire chart will be drawn again.
Sample
Example: The existing data is from 2001 to 2010. chart1.appendXML(WebSquare.ModelUtil.findInstanceNode('currentWork'), 3, false ); The data of 2011 will be appended. However, because the maxCount is 3, the data from 2009 to 2011 will be refelected.
applySeriesConfig( useDoubleChart , seriesUseChk , seriesAxisChk , chartType , chartType )
Sets the series-related configuration for the chart.
Parameter
nametyperequireddescription
useDoubleChartBooleanYWhether to use the double chart or not. In case of ture, the double chart will be used.
seriesUseChkArrayYWhether to use the series or not. The element with true value will be displayed on the drawLayer.
seriesAxisChkArrayYAn array showing whether the series axis is used or not through Y and Y1.
'Y' is for the corresponding sereis, and 'Y1'is to display the second series as the second chart in the double chart. For other characters, the series will not be displayed.
chartTypeStringYString indicating the type of the chart
COLUMN, ACCUMULATIVE_COLUMN, PERCENTAGE_ACCUMULATIVE_COLUMN, COLUMN_3D, COLUMN_3D2, ACCUMULATIVE_COLUMN_3D, PERCENTAGE_ACCUMULATIVE_COLUMN_3D, BAR, ACCUMULATIVE_BAR, PERCENTAGE_ACCUMULATIVE_BAR, BAR_3D, ACCUMULATIVE_BAR_3D, PERCENTAGE_ACCUMULATIVE_BAR_3D, LINE, POINT_LINE, ACCUMULATIVE_LINE, PERCENTAGE_LINE, PIE, DONUT, RADIAL, POINT_RADIAL, POINT_CIRCLE_RADIAL
chartTypeStringYString indicating the type of the second chart in the double chart
COLUMN, ACCUMULATIVE_COLUMN, PERCENTAGE_ACCUMULATIVE_COLUMN, COLUMN_3D, COLUMN_3D2, ACCUMULATIVE_COLUMN_3D, PERCENTAGE_ACCUMULATIVE_COLUMN_3D, BAR, ACCUMULATIVE_BAR, PERCENTAGE_ACCUMULATIVE_BAR, BAR_3D, ACCUMULATIVE_BAR_3D, PERCENTAGE_ACCUMULATIVE_BAR_3D, LINE, POINT_LINE, ACCUMULATIVE_LINE, PERCENTAGE_LINE, PIE, DONUT, RADIAL, POINT_RADIAL, POINT_CIRCLE_RADIAL
Sample
chart1.applySeriesConfig(true, [true,true,false], ['Y','Y1','Y'] , 'COLUMN', 'POINT_LINE'); The first series is COLUMN type and displayed on the chart. The second series is POINT_LINE type and displayed on the double chart. The third series is COLUMN type and is not displayed on the chart.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
eventTypeStringYEvent to allocate
functionFunctionYHandler function of the event
Sample
// (Example 1) // Define a function for the onclick event of input1. input1.bind("onclick", function(e){ alert(input1.getValue();})); // (Example 2) // Define commObj.ev_click function in advance. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; // Dynamically allocate onclick event and the handler function to input1 component. input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be changed.
In order to remove classes directly defined in the class propert of the WebSquare component, add the following in config.xml. // Add the following in config.xml.
Parameter
nametyperequireddescription
oldClassNameStringYClass to change
newClassNameStringYClass to newly use
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Change the class. // Change tmpInputClass class to tmpInputWarninClass. input1.changeClass("tmpInputClass","tmpInputWarninClass");
deleteData( )
Deletes the chart data.
Sample
chart1.deleteData();
excelDownload( options )
Downloads the chart data as an Excel file.
Parameter
nametyperequireddescription
optionsObjectYExcel downloading options for the grid data saved in JSON format
<Boolean:Y> options.showProcess : Whether to show the process window or not during the downloading <String:Y> options.fileName : Name of the file to download
Sample
var options = {showProcess : true , fileName : "excel"}; chart1.excelDownload(options);
focus( )
Focuses the WebSquare component. (Supported in all WebSquare components.)
getDataListInfo( )
Returns the dataList bound with the component.
Return
typedescription
ObjectReturns nodeset, label, and value id as an object.
Sample
// Example chart1.getDataListInfo();
getDisabled( )
Returns the current value of the disabled property. (Supported in all WebSquare components.)
Return
typedescription
BooleanValue of the disabled property
Sample
// (Example) Check the current value of the disabled property. var returnValue = componentId.getDisabled(); // (Return Example) false
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself. (Supported in all WebSquare components.)
Return
typedescription
ObjectParent Generator object
Sample
// (Example) The Generator (parent) create a Trigger (child). <w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> // In the example below, upon the end user’s clicking the Trigger 1, the generator1 object will be displayed on the console. scwin.trigger1.onclick = function(){ console.log(this.getGenerator());}
getID( )
Returns the ID of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringWebSquare component ID
Sample
// Upon dynamically receiving a WebSquare component, the ID can be checked as shown below. function fn_validCheck(tmpObj){ var compID = tmpObj.getID(); } // If the tmpObj in the above example has "input1" ID. // (Return) "input1"
getInitStyle( CSS )
Returns the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
CSSStringNProperty (If not specified, all properties will be displayed.)
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
The Engine returns the opacity value of the CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply the opacity CSS to the InputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> // Return the opacity of the InputBox. var returnValue = input1.getOpacity(); // A real number between 0 and 1 will be returned. // (Return) "0.2"
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
The originalID is valid when the scope function is in use.
For scope="true" WFrame, component IDs inside the WFrame is changed with the prefix(wframeID + "_") being added before the ID given by the user (originalID).
The originalID means the ID before the prefix being added.
Return
typedescription
StringoriginalID of the component
Sample
// An example of multi-WFrame page // Main page with a WFrame (main.xml) <w2:wframe id="wframe1" src="text.xml" scope="true"/> // Source page to be contained in the WFrame (text.xml) <w2:textbox id="textbox1"/> // (Example) Check the Id and the original ID in the script of text.xml // Run getID. textbox1.getID(); // "wframe1_textbox1" is returned. // Run getOriginalID. textbox1.getOriginalID(); // "textbox1" is returned.
getPluginName( )
Returns the name of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringName of the WebSquare component (pluginName)
Sample
// When a common function dynamically receives a WebSQuare object as shown below, different actions can be made for each component type. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component name if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
When the position is set in 0%, the value will be converted into %.
Parameter
nametyperequireddescription
positionNameStringY[left, top] Position type
Return
typedescription
NumberPosition of the component
Sample
// CSS margin is applied to the Input component as shown below. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> // (Example) Check the top value of the InputBox. var returnValue = input1.getPosition("top"); // Position value in pixels will be returned. // (Return) 10
getReadOnly( )
Returns the current value of the readOnly property. (Supported in all WebSquare components.)
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
// Example to check the readOnly setting of the component. var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
For scope="true" WFrame, null will be returned.
Return
typedescription
ObjectWFrame object or null
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. textbox1.getScope(); // (Return Example) wframe11 object
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
If not a child of a scope="true" WFrame, a global window object will be returned.
Return
typedescription
ObjectScope object of the WFrame or a global window object
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. var scope = textbox1.getScopeWindow(); scope.wframe11 === textbox1.getScope(); // true
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
If set in %, values will be converted into pixels.
Parameter
nametyperequireddescription
sizeNameStringYSize types. For calculation of each size type, see the below:
height : element.clientHeight innerHeight : element.clientHeight + padding outerHeight : element.clientHeight + padding + border outerMarginHeight : element.clientHeight + padding + border + margin width : element.clientWidth innerWidth : element.clientWidth + padding outerWidth : element.clientWidth + padding + border outerMarginWidth : element.clientWidth + padding + border + margin
Return
typedescription
NumberSize of the component
Sample
var returnValue = componentId.getSize("width"); // (Return Example) 100 // Values are in pixels. // If set in %, values will be converted into pixels.
getStyle( propertyName )
Returns the CSS setting of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to return
Return
typedescription
StringCSS value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> // (Example) Check the width of the InputBox above. var returnValue = input1.getStyle("width"); // (Return) "144px"
getStyleValue( style )
[deprecated]
Use getStyle instead.
Returns the current CSS applied to the WebSquare component.
Parameter
nametyperequireddescription
styleStringYCSS property to return
Return
typedescription
StringCSS value (Colors are returned in HexCode.)
getTitle( )
Returns the title of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringTitle
Sample
// In the following example, the Title is “Input Name”. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example) “Enter your name.”
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
The file name includes .xml. In order to get the file path without .xml, use getUdcRoot.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Result) /a/b/udc.xml
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
Not contains the file name. In order to get a path including the file name, use getUdcHome.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Execution Result) /a/b/
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
keyStringYData key
Return
typedescription
StringValue for the given key
Sample
// (Example) Setting the user property (setTest) in the InputBox <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" setTest="Hello"></xf:input> // Returns the value of the setTest property. input1.getUserData("setTest"); // (Return) "Hello" // Set 'valueTest' (key) and 'WebSquare' (data) through setUserData. input1.setUserData("valueTest","WebSquare"); // Returns the value of the setTest property. input1.getUserData("WebSquare"); // (Return) "WebSquare"
hasClass( className )
Checks whether the WebSquare component has a certain class. (Supported in all WebSQuare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to check
Return
typedescription
BooleanWhether the class exists or not
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return) true
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
display:none; or visibility:hidden; CSS is applied.
Sample
// (Example) Hide the component. componentId.hide();
redraw( )
Redraws the chart.
Sample
chart1.redraw();
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
// If the class is directly defined as an InputBox property. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // In the config.xml file, add the following. <style> <removeDefaultClass value="true" /> </style> // Classes can be removed by removeClass. input1.removeClass("tmpInputClass");
setAccessibility( flag )
Supports the web accessibility to the WebSquare5 charts.
Parameter
nametyperequireddescription
flagStringYA value required to turn on/off the feature to support web accessibility
setChartType( chartType )
Changes the type of the chart.
Parameter
nametyperequireddescription
chartTypeStringYType of the new chart
COLUMN, ACCUMULATIVE_COLUMN, PERCENTAGE_ACCUMULATIVE_COLUMN, COLUMN_3D, COLUMN_3D2, ACCUMULATIVE_COLUMN_3D, PERCENTAGE_ACCUMULATIVE_COLUMN_3D, BAR, ACCUMULATIVE_BAR, PERCENTAGE_ACCUMULATIVE_BAR, BAR_3D, ACCUMULATIVE_BAR_3D, PERCENTAGE_ACCUMULATIVE_BAR_3D, LINE, POINT_LINE, ACCUMULATIVE_LINE, PERCENTAGE_LINE, PIE, DONUT, RADIAL, POINT_RADIAL, POINT_CIRCLE_RADIAL
Sample
chart1.setChartType('POINT_LINE');
setDataCollection( dataList , labelId , append , modify )
Sets the data of the specified DataCollection to the chart.
Parameter
nametyperequireddescription
dataListObjectYDataList of the chart. For the legends, add as the name in the column as shown below. See the example below.
<w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="label" dataType="text"></w2:column> <w2:column id="col0" name="2007-04-01" dataType="text"></w2:column> <w2:column id="col1" name="2007-06-01" dataType="text"></w2:column> <w2:column id="col2" name="2007-08-01" dataType="text"></w2:column> <w2:column id="col3" name="2007-10-01" dataType="text"></w2:column> </w2:columnInfo> </w2:dataList> </w2:dataCollection> var jsonData = [{"col0":"07","col1":"18","col2":"24","col3":"42","label":"Fund Asset"},{"col0":"57","col1":"31","col2":"44","col3":"75","label":"Foreign Asset"}]; $p.data.dataList1.setJSON(jsonData);
labelIdStringNID of the column that has the label data in the DataList. The data of the corresponding column will be recognized as the label, and the data of other columns will be recognized as data. If not specified, the column of Index 0 will be used as the label.
appendBooleanNWhether to append or not. The default is false that will delete the existing data.
modifyBooleanNWhether to modify or not. The default is false. In case of true, only the data layer will be drawn again, and in case of false, the entire chart will be drawn again.
Sample
chart1.setDataCollection($p.data.dataList1, "label"); Notify the column ID that is used as the label through the second argument. If the second argument is not specified, the column of Index 0 (the "label" column in the above example) will be used as the label. The third argument is to specify whether to delete the existing data or to append the new data at the end. If not specified, the existing data will be deleted. hen the modify property is true, redraw the chart.
setDisabled( disabled )
Sets the disabled property of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
disabledBooleanYDisabled status
true: Disabled. false: Not disabled.
Sample
// Sets the disabled property in the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Pauses the event. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
evListStringNList of the events to pause. (in case of null, all events of the corresponding WebSquare component is paused or restarted.)
flagBooleanYWhether to pause the event or not.
true: Pause. false: Not pause.
Sample
// (Example 1) // Pause the onclick event. input1.setEventPause("onclick", true); // (Example 2) // Restart the onfocus and the onblur events. input1.setEventPause("onfocus,onblur", false); // (Example 3) // Pause all events registered in input1. input1.setEventPause(null, true);
setInitStyle( property )
Restores the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyStringNCSS property (If not spcified, all properties will be restored.)
Sample
// (Example) group1.setInitStyle();
setMaxYAxis( maxYaxis )
Sets the maximum value of the Y axis, and displays it.
Parameter
nametyperequireddescription
maxYaxisNumberYThe maximum value on the Y axis
setMinYAxis( minYaxis )
Sets the minimum value of the Y axis, and displays it.
Parameter
nametyperequireddescription
minYaxisNumberYMinimum value on the Y axis
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
The engine sets the opacity property (of CSS).
Parameter
nametyperequireddescription
valueNumberYOpacity (Real number between 0 and 1)
Sample
// (Example) Set the opacity as 0.45. componentId.setOpacity(0.45);
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
leftNumberYLeft position value or null
topNumberYTop position value or null
modeStringNPosition setting method. [default: absolute, delta]
absolute: The inputted value becomes the position. delta: The inputted value is added to the current position.
Sample
// (Example) Set the top position as 100px. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
readOnlyBooleanYSetting of the readOnly property. (“true”: Used. “false”: Not used.)
Sample
// Set the readOnly property as true. componentId.setReadOnly(true);
setSeriesAxis( seriesAxisChk )
Sets the series for the drawing layer of the chart.
Parameter
nametyperequireddescription
seriesAxisChkStringYThis string is to specify whether to check the series axis. Use space as the delimiter. Y is for the corresponding series, and Y1 is for the second chart of the double chart. Other characters will be ignored. For other characters, the series will not be displayed.
Sample
chart1.setSeriesAxis("Y N Y Y1"); Draw again with redraw functon. Display the first and the third series on the chart. In case of a double chart, draw the fourth series on the second chart. If the double chart is not used, only the first and the third series will be drawn.
setSize( width , height )
Sets the size of the chart.
Parameter
nametyperequireddescription
widthIntegerYWidth of the chart
heightIntegerYHeight of the chart
Sample
chart1.setSize(500,300);
setTitle( title )
Sets the title of the WebSquare component.
Parameter
nametyperequireddescription
titleStringYValue to set
Sample
// Set the title as "test". chart1.setTitle("test");
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
Enter key values supported by the component. In case a key value not supported by the component is entered, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYData key to set
valueStringYDefined data value
Sample
// Set 'data' key and 'WebSquare' value in the component. componentId.setUserData("data", "WebSquare"); // The key must be supported in the component. componentId.setUserData("title", "WebSquare"); // Following logs will be displayed. // !!!WARNING - [title] can't be defined as UserData.
setValue( value , seriesIndex , dataIndex )
Sets the received seriesIndex or dataIndex as the value.
Parameter
nametyperequireddescription
valueNumberYValue to set
seriesIndexIntegerYIndex of the series
dataIndexIntegerYIndex of the data
setXML( data , append , modify )
Sets the XML data in the chart.
Parameter
nametyperequireddescription
dataXML DocumentYXML document for the chart
<works> <series> <label value="방송"/> <label value="영화"/> <label value="도서"/> </series> <data key="0"> <label value="2006"/> <value key="0" value="0"/> <value key="1" value="0"/> <value key="2" value="100"/> </data> </works>
appendBooleanNWhether to append or not. The default is false that will delete the existing data.
modifyBooleanNWhether to modify or not. The default is false. In case of true, only the data layer will be drawn again, and in case of false, the entire chart will be drawn again.
Sample
Example: A chart with TV (0), Movie (0), and Book (100) chart1.setXML(WebSquare.ModelUtil.findInstanceNode("works"), true, false); When append is "true", the result will be the same as that of chart1.appendXML(WebSquare.ModelUtil.findInstanceNode("works")); code. When modify is "true", draw the chart again with the redrawing function to reflect the new data.
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
Sets the display property as specified and applies "visibility: show;" CSS.
Parameter
nametyperequireddescription
displayTypeStringNCSS display setting to apply.
block : Uses “display: block;”. (Default) inline : display: inline; none : display: none; "" : Restores to the previous display setting.
Sample
// (Example) display: block; componentId.show(); // (Example) Restore the previous display setting. componentId.show("");
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
Removes the class from the WebSquare component.
If the WebSquare component does not have the specified class, adds the class.
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYClass to add or remove
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add the (previously removed) tmpInputClass. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event in the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
typeStringYEvent to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// (Example 1) // Trigger the onclick event in input1 component. input1.trigger("onclick"); // (Example 2) // Trigger the onviewchange event in input1, and send (1, 2) parameter to the handler function. input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes the event from the component. (Supported in all WebSquare component.)
Parameter
nametyperequireddescription
typeStringNEvent to remove. (If not specified, all events of the component will be removed.)
functionFunctionNHandler function of the event to remove. (If not specified, all handler functions of the event will be removed.)
Sample
// (Example 1) // Remove all events registered in the input1 component. input1.unbind(); // (Example 2) // Remove all handler functions for the onviewchange event of the input1 component. input1.unbind("onviewchange"); // (Example 3) // Remove func1 for the onviewchange event of the input1 component. input1.unbind("onviewchange", func1);
visible( flag )
[deprecated]
Use show/hide or setStyle instead.
The Engine sets the CSS visibility property.
Parameter
nametyperequireddescription
flagBooleanYCSS visibility setting
true : visibility: visible; false : visibility: hidden;