PropertyEventMethodIndex
WebSquare.uiplugin.chart - 5.0_2.2916B.20171222.151448

Generates various types of charts. The type property allows the developer to choose the chart type.
Supports 22 kinds of charts including column, bar, line, radial, pie, and 3D, and can generate double-charts in which two types are charts are used.
Not recommended for mobile. Use FusionChart for mobile.
At the highest of the Chart component is the HTML div tag.

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
ID of the component. Allocated as a global object. Scripts access the component through the 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
Same as the tabindex property in HTML standard. Indicates the focusing order of the component 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
Title of the chart
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
Tooltip of the component
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 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 allocates events to the component.
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
deleteData( )
Deletes the chart data.
excelDownload( options )
Downloads the chart data as an Excel file.
focus( )
Moves the focus to the component.
getDataListInfo( )
Returns the DataLists bound with the Image.
getDisabled( )
Gets the current value of the disabled property.
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
getID( )
Gets the ID of the component.
getInitStyle( property )
Gets the initial style of the component.
getOpacity( )
Gets the opacity of the component defined in CSS.
getPluginName( )
Gets the pluginName (or the name) of the component.
getPosition( positionName )
Gets the left or top position of the component.
getReadOnly( )
Gets the current setting of the readOnly property.
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true).
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true).
getSize( sizeName )
Gets the size of the component.
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
getStyleValue( style )
[deprecated] Use getStyle instead.
getTitle( )
Gets the title value.
getUdcHome( )
Returns the path of the file which defines the UDC.
getUdcRoot( )
Returns the path of the file which defines the UDC.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
hasClass( className )
Checks whether the component has className received as a parameter or not.
hide( )
Hides the component.
redraw( )
Redraws the chart.
removeClass( className )
Removes className from the component.
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.
setEventPause( evList , flag )
Disables or enables the component event.
setInitStyle( property )
Initializes the component style.
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 of the component.
setPosition( left , top , mode )
Sets the position (left, top) of the component.
setReadOnly( readOnly )
Controls the "readOnly" property.
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 chart.
setUserData( key , value )
Sets the user data in the component.
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 )
Displays the component.
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
trigger( type , array )
Triggers a certain event registered for the component.
unbind( type , function )
Removes an event registered for the component.
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.

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
ID of the component. Allocated as a global object. Scripts access the component through the 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
Same as the tabindex property in HTML standard. Indicates the focusing order of the component 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
Title of the chart
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
Tooltip of the component
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 class to the component.
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// Add oddClass to component input1. 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 allocates events to the component.
Parameter
nametyperequireddescription
eventTypeStringYName of the event to allocate.
functionFunctionYHandler function of the event to allocate.
Sample
// Define the event handler function for the onclick event in the input component, and bind the function. input1.bind("onclick", function(e){ alert(input1.getValue();})); // Bind commObj.ev_click function for the onclick event with component input1. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
In the default setting, only the classes added by addClass will be applied. In order to directly remove the class defined in the "class" property of the component, add the following setting in config.xml file.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
oldClassNameStringYName of the class to remove
newClassNameStringYName of the class to add
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // 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( )
Moves the focus to the component.
getDataListInfo( )
Returns the DataLists bound with the Chart.
Return
typedescription
Object:YdataList Info
getDisabled( )
Gets the current value of the disabled property.
Return
typedescription
BooleanThe value of the disabled property.
Sample
var returnValue = componentId.getDisabled(); (Return example) false
getGenerator( )
Called by a component under the Generator component. When called, gets the parent Generator object.
Return
typedescription
ObjectParent Generator object
Sample
<w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> scwin.trigger1.onclick = function(){ console.log(this.getGenerator());} // Click trigger1 to display the generator1 object on the console. // See https://inswave.com/jira/browse/WPF-1425.
getID( )
Gets the ID of the component.
Return
typedescription
StringID of the WebSquare5 component
Sample
// The WebSquare5 component dynamically received as a parameter can be used as shown in the following. function fn_validCheck(tmpObj){ // tmpObj has an ID of "input1". var compID = tmpObj.getID(); // (Return Example) "input1" }
getInitStyle( property )
Gets the initial style of the component.
Parameter
nametyperequireddescription
propertyStringNName of the attribute (If not specified, all information will be ouputted.)
getOpacity( )
Gets the opacity of the component defined in CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply opacity CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> var returnValue = input1.getOpacity(); // "returnValue" is a real number between 0 and 1. // (Return Value) "0.2"
getPluginName( )
Gets the pluginName (or the name) of the component.
Return
typedescription
StringpluginName of the WebSquare5 component
Sample
// For a WebSquare5 object dynamically received by a common function, conditional statements can be used as shown below. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component Type if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Gets the left or top position of the component. If set by %, the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
positionNameStringY[left,top] Type of the position
Return
typedescription
NumberPosition of the component
Sample
// Apply margin CSS to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> var returnValue = input1.getPosition("top"); // The returnValue will be a position in pixels. // (Return Example) 10
getReadOnly( )
Gets the current setting of the readOnly property.
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns null when the component is not a child of the WFrame using the scope feature (scope=true).
Return
typedescription
Objectwframe object or null
Sample
// The main page contains wframe1, and wframe1 contains wframe11 which contains textbox1. textbox1.getScope(); // Returns wframe11 object.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns a global window object when the component is not a child of the WFrame using the scope feature (scope=true.
Return
typedescription
ObjectScope object of the wframe object, or a global window object
Sample
// The main page contains wframe1, and wframe1 contains wframe11 which contains textbox1. var scope = textbox1.getScopeWindow(); scope.wframe11 === textbox1.getScope(); // true
getSize( sizeName )
Gets the size of the component. If set by "%", the corresponding pixel value will be returned.
Parameter
nametyperequireddescription
sizeNameStringY[height, innerHeight, outerHeight, outerMarginHeight, width, innerWidth, outerWidth, outerMarginWidth] Type of the size. For the calculation of each size type, see 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"); // "returnValue" will be a size in pixels. If set by "%", the corresponding pixel value will be returned. // (Return Example) 100
getStyle( propertyName )
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
propertyNameStringYName of the property in the style
Return
typedescription
StringStyle value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> var returnValue = input1.getStyle("width"); // (Return Example) "144px"
getStyleValue( style )
[deprecated] Use getStyle instead.
Gets the current value of the propertyName of the component defined in CSS.
Parameter
nametyperequireddescription
styleStringYName of the property defined in the style
Return
typedescription
StringValue defined in the style property. (In case of a color, the hexcode of the color will be returned.)
getTitle( )
Gets the title value.
Return
typedescription
StringTitle value
Sample
// Define the "title" for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example ) "Input Name"
getUdcHome( )
Returns the path of the file which defines the UDC. Includes the file extension of .xml. For a path without .xml, use getUdcRoot. When called by a component, not a UDC object, undefined will be returned.
Return
typedescription
StringWhen called by a component, not a UDC object, undefined will be returned.
Sample
The udc file is /a/b/udc.xml, the XML file is /a/c/main.xml, and the UDC object ID is udc1. udc1.getUdcHome(); // The execution result is /a/b/udc.xml.
getUdcRoot( )
Returns the path of the file which defines the UDC. udc1.getUdcHome(); // The execution result is /a/b/udc.xml. For a path including .xml, use getUdcHome. When called by a component, not a UDC object, undefined will be returned.
Return
typedescription
StringWhen called by a component, not a UDC object, undefined will be returned.
Sample
The udc file is /a/b/udc.xml, the XML file is /a/c/main.xml, and the UDC object ID is udc1. udc1.getUdcHome(); // The execution result is /a/b/udc.xml.
getUserData( key )
Returns the user-defined property value set by setUserData as the user data or source (page XML).
Parameter
nametyperequireddescription
keyStringYRandom data key
Return
typedescription
StringData of the corresponding key
Sample
// Apply the customized property (eduTest) to the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" eduTest="Hello"></xf:input> input1.getUserData("eduTest"); // (Return Example) "Hello" // Use setUserData. input1.setUserData("eduTest","WebSquare"); input1.getUserData("WebSquare"); // (Return Example) "Hello"
hasClass( className )
Checks whether the component has className received as a parameter or not.
Parameter
nametyperequireddescription
classNameStringYclassName to check
Return
typedescription
BooleanWhether the component has the class or not
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return Example) true
hide( )
Hides the component.
he CSS setting will be "display:none;" and "visibility:hidden;".
Sample
componentId.hide();
redraw( )
Redraws the chart.
Sample
chart1.redraw();
removeClass( className )
Removes className from the component.
In the default setting, only the classes added by addClass will be applied. In order to directly remove the class defined in the "class" property of the component, add the following setting in config.xml file.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. 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"}]; $w.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($w.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. True to disable, or false not to disable.
Parameter
nametyperequireddescription
disabledBooleanYTrue to disable, or false not to disable.
Sample
// Disable the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Disables or enables the component event.
Parameter
nametyperequireddescription
evListStringNList of the events. If not specified, all user events of the component will be listed. (Enter null data.)
flagBooleanYtrue is to pause, or false is to cancel pausing.
Sample
input1.setEventPause("onclick", true); // Dynamically pauses the onclick event. input1.setEventPause("onfocus,onblur", false); // Restarts the onfocus and the onblur events. input1.setEventPause(null, true); // Pauses all user events registered for the Input component.
setInitStyle( property )
Initializes the component style.
Parameter
nametyperequireddescription
propertyStringNName of the property (If not specified, all properties will be returned.)
Sample
group1.getInitStyle();
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 of the component.
Parameter
nametyperequireddescription
valueNumberYOpacity value (A real number between 0 and 1)
Sample
componentId.setOpacity(0.45);
setPosition( left , top , mode )
Sets the position (left, top) of the component.
Parameter
nametyperequireddescription
leftNumberYLeft position or null.
topNumberYTop position or null.
modeStringN[defulat:absolute, delta] absolute sets the current positions as x and y, and delta adds x and y to the current positions.
Sample
// Set the top position of the component as 100 pixels. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Controls the "readOnly" property. True to enable, or false to disable.
Parameter
nametyperequireddescription
readOnlyBooleanYTrue to enable, or false to disable.
Sample
// Enable the read-only. 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 chart.
Parameter
nametyperequireddescription
titleStringYTitle
Sample
chart1.setTitle("Art List");
setUserData( key , value )
Sets the user data in the component. If the key cannot be set for the component, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYRandom data key
valueStringYRandom data key
Sample
// Setting a (key, value) pair of ("data", "WebSquare5") in the component. componentId.setUserData("data", "WebSquare"); // Some keys cannot be set for the component. componentId.setUserData("title", "WebSquare"); // (Log Example) !!!WARNING - [title] can't define 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 )
Displays the component.
The related CSS properties are display and visibility:show;.
Parameter
nametyperequireddescription
displayTypeStringN[default:block ,inline ,none ,""] Value of the Display property.
Sample
// Block the "display" property. componentId.show(); // Enable the "display" property in the class. componentId.show("");
toggleClass( className )
Removes a class named className, or if there is no such a class, adds a class named className.
In the default setting, only the classes added by addClass can be removed. To remove other classes, add the following setting in config.xml.
<style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYclassName to set
Sample
// Define a class for the Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following to config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add tmpInputClass class again. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event registered for the component.
Parameter
nametyperequireddescription
typeStringYName of the event to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// Trigger the onclick event in the input1 component. input1.trigger("onclick"); // Trigger the onviewchange event in the input component and call the event handler function by sending arguments of (1, 2). input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes an event registered for the component.
Parameter
nametyperequireddescription
typeStringNName of the event to remove. If not specified, all events of the components will be removed.
functionFunctionNHandler function of the event to remove. If not specified, all handler functions of the event will be removed.
Sample
// Remove all events registered in the input component. input1.unbind(); // Remove all handler functions of onviewchange event registered in the input component. input1.unbind("onviewchange"); // Remove the func1 event handler of onviewchange event registered for component input1. input1.unbind("onviewchange", func1);
visible( flag )
[deprecated] Shows/Hides the component, or sets the visible property using setStyle.
Sets the visibility of the component style. In case of true, set visible. In case of false, set hidden.
Parameter
nametyperequireddescription
flagBooleanYVisibility (In case of true, set visible. In case of false, set hidden.)