PropertyEventMethodIndex
WebSquare.uiplugin.fwGanttChart - 5.0_1.3015A.20180410.143527

fwGanttChart is a FusionWidget wrapper component. FusionWidgets data combines actual chart data with the style options. WebSquare5 provides APIs for the developers to separate them and to easily customize the chart. For more information about properties and APIs, visit the official page of FusionCharts (http://docs.fusioncharts.com/charts/)

Type

uiplugin

Property Summary

autoCategory
Generates category in the fwGanttChart.
categoryDepth
Sets the category depth when the category is automatically created.
dataColumns
[default:""] Column ID to be used in the datatable. (Multiple IDs can be used with use of “,” separator.)
dateformat
Date format of the chart
endDateNode
Column ID to use as the endDateNode when binding the chart with a DataList
id
Component ID
monthNames
Month names for the fwGanttChart categories.
multiTasks
Uses the multiTasks in the chart.
plotColor
Dataplot color of the chart
processNode
Column ID to use as the processNode when binding the chart with a DataList
quarterNames
Sets the quarterNames required to create category for the chart.
ref
Binds the fwGanttChart with a DataList.
resizeLastMonth
[default:false, true] Adjusts the width according to the number of 2-depth columns belonging to the last column with timeBase="date" and categoryDepth="2".
startDateNode
Column ID to use as the startDateNode when binding the chart with a DataList
taskIdNode
Column ID to use as the taskIdNode when binding the chart with a DataList
taskNode
Column ID to use as the taskNode when binding the chart with a DataList
timeBase
Timebase of the chart
timeGap
Sets the time gap when the category is auto.
version
FusionChart version.

Event Summary

Method Summary

addCategories( fwGanttChart )
Adds catagories.
addClass( className )
Adds a class to the component.
bind( eventType , function )
Dynamically allocates events to the component.
changeClass( oldClassName , newClassName )
Renames the class from oldClassName to newClassName.
draw( )
Renders the chart.
exportJSChart( type )
Exports charts rendered in JavaScript in JPG, PNG, and PDF formats.
fc( )
Returns a fusionWidget object of the fwGanttChart type.
focus( )
Moves the focus to the component.
getChartAttribute( name )
Returns the chart attributes.
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.
getJSONData( )
Returns the chart data as a JSON object.
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.
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.
getSVGString( )
Returns the chart SVG in the string format.
getTitle( )
Gets the title value.
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.
removeClass( className )
Removes className from the component.
setCategories( fwGanttChart )
Sets the categories of the chart.
setChartAttribute( options )
Changes the attribute values of the chart.
setConnector( info )
Sets connectors among the tasks.
setDatatableAttribute( datatable )
Sets the properties used by the datatable of the fwGanttChart.
setDisabled( disabled )
Sets the disabled property.
setEventPause( evList , flag )
Disables or enables the component event.
setJSONData( json )
Sets the chart data with the given JSON object.
setMilestone( Milestone )
Sets the task milestones.
setOpacity( value )
Sets the opacity of the component.
setPosition( left , top , mode )
Sets the position (left, top) of the component.
setProcessesAttribute( processAttributes )
Sets the process attributes.
setReadOnly( readOnly )
Controls the "readOnly" property.
setSize( width , heigth )
Sets the size (width, height) of the component.
setStyle( propertyName , value )
Sets the style of the specified property.
setTaskAttribute( taskAtribute )
Sets the task in the fwGanttChart.
setTasksColor( taskID , color )
Sets the task color.
setTrendLine( trendLine )
Adds a vertical line.
setUserData( key , value )
Sets the user data in the component.
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

autoCategory
Generates category in the fwGanttChart.
categoryDepth
Sets the category depth when the category is automatically created.
dataColumns
[default:""] Column ID to be used in the datatable. (Multiple IDs can be used with use of “,” separator.)
(Similar to the processes. The difference is that it allows insertion of multiple columns to the left in the graph.)
Related API: setDatatableAttribute (Sets the column attributes in the datatable.)
dateformat
Date format of the chart
endDateNode
Column ID to use as the endDateNode when binding the chart with a DataList
id
Component ID
monthNames
Month names for the fwGanttChart categories.
multiTasks
Uses the multiTasks in the chart.
plotColor
Dataplot color of the chart
processNode
Column ID to use as the processNode when binding the chart with a DataList
quarterNames
Sets the quarterNames required to create category for the chart.
ref
Binds the fwGanttChart with a DataList.
resizeLastMonth
[default:false, true] Adjusts the width according to the number of 2-depth columns belonging to the last column with timeBase="date" and categoryDepth="2".
For example, if the last day of the chart is July 12 falling in the third quarter, the third quarter will include only July and the width is accordingly smaller.
true: Adjusts the width. false (Default): Does not adjust the width. Regardless of the number of the 2-depth columns in the last category, all category will have the same width.
startDateNode
Column ID to use as the startDateNode when binding the chart with a DataList
taskIdNode
Column ID to use as the taskIdNode when binding the chart with a DataList
taskNode
Column ID to use as the taskNode when binding the chart with a DataList
timeBase
Sets the timebase in the fwGanttChart.
timeGap
Sets the time gap when the category is auto.
version
FusionChart version.

Event Detail

Method Detail

addCategories( fwGanttChart )
Adds categories.
Parameter
nametyperequireddescription
fwGanttChartObjectYCategory data
Sample
var data = {"category":[ {"start":"02/01/2015","end":"03/31/2015","label":"Q1"}, {"start":"04/01/2015","end":"06/30/2015","label":"Q2"} ] }; fwGanttChart1.addCategories(data);
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");
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");
draw( )
Renders the chart.
Sample
fwGaugeChart1.draw();
exportJSChart( type )
Exports charts rendered in JavaScript in JPG, PNG, and PDF formats.
Parameter
nametyperequireddescription
typeStringYFile type. Default : jpg
Sample
fwGanttChart.exportJSChart("pdf");
fc( )
Returns a fusionWidget object of the fwGanttChart type. Using the fusionWidget object, it is possible to call the native APIs that support the fusionWidget.
Return
typedescription
ObjectFusionWidget object
Sample
chart1.fc().getJSONData();
focus( )
Moves the focus to the component.
getChartAttribute( name )
Returns the chart attributes.
Parameter
nametyperequireddescription
nameStringYName of the attribute
Return
typedescription
StringValue of the attribute
Sample
chart1.getChartAttribute("caption");
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" }
getJSONData( )
Returns the chart data as a JSON object.
Return
typedescription
ObjectChart data
Sample
chart1.getJSONData();
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
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.)
getSVGString( )
Returns the chart SVG in the string format.
Return
typedescription
StringPre-processed SVG string
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"
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();
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");
setCategories( fwGanttChart )
Sets the categories of the chart.
Parameter
nametyperequireddescription
fwGanttChartObjectYCategory data
Sample
var data = {"category":[ {"start":"02/01/2015","end":"03/31/2015","label":"Q1"}, {"start":"04/01/2015","end":"06/30/2015","label":"Q2"} ] }; fwGanttChart1.setCategories(data);
setChartAttribute( options )
Changes the attribute values of the chart.
Parameter
nametyperequireddescription
optionsObjectYOption object to add
Sample
var options = { caption : "Monthly Revenue", subCaption : "subcaption test", xAxisName : "Month", yAxisName:"Revenue" } fwGanttChart1.setChartAttribute(options);
setConnector( info )
Sets connectors among the tasks.
Parameter
nametyperequireddescription
infoObjectYConnection
Sample
var info = { "fromtaskid": "2", "totaskid": "1", "thickness": "2" }; fwGanttChart1.setConnector(info);
setDatatableAttribute( datatable )
Sets the properties used by the datatable of the fwGanttChart.
Related property: dataColumns (To set the column ID to be used by the datatable.)
Parameter
nametyperequireddescription
datatableObjectYAttribute
Sample
// The datatable uses multiple columns. |var obj = { "headerbgcolor": "#999999", "headerfontcolor": "#ffffff", "datacolumn" : [ { "bgcolor": "#eeeeee", "headertext": "ActualStartDate" }, { "bgcolor": "#eeeeee", "headertext": "ActualEndDate" }] }; fwGanttChart1.setProcessesAttribute(info);
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.
setJSONData( json )
Sets the chart data with the given JSON object.
Parameter
nametyperequireddescription
jsonObjectYChart data
setMilestone( Milestone )
Sets the task milestones.
Parameter
nametyperequireddescription
MilestoneObjectY
Sample
var info = { "date": "05/01/2015", "taskid": "3", "color": "#f8bd19", "shape": "star", "tooltext": "MileStones" }; fwGanttChart1.setMilestones(info);
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);
setProcessesAttribute( processAttributes )
Sets the process attributes.
Parameter
nametyperequireddescription
processAttributesObjectY
Sample
var info = { "align":"right", "hoverBandColor":"990000", "isBold":"1", "fontSize":"15" }; fwGanttChart1.setProcessesAttribute(info);
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);
setSize( width , heigth )
Sets the size (width, height) of the component.
Parameter
nametyperequireddescription
widthNumberYComponent width or null
heigthNumberYComponent height or null
Sample
// Set the component height as 100 pixels. componentId.setSize(null,100);
setStyle( propertyName , value )
Sets the style of the specified property.
Parameter
nametyperequireddescription
propertyNameStringYName of the style
valueStringYValue of the style
Sample
// Set the component width as 200px. componentId.setStyle("width", "200px"); // Change the background color to olive. componentId.setStyle("background-color","olive");
setTaskAttribute( taskAtribute )
Sets the task in the fwGanttChart.
Parameter
nametyperequireddescription
taskAtributeObjectY
Sample
var info = { "fontcolor":"ff0000", "showenddate":"1", "fontSize":"20" }; fwGanttChart1.setTaskAttribute(info);
setTasksColor( taskID , color )
Sets the task color.
Parameter
nametyperequireddescription
taskIDStringYTask ID
colorStringYColor to use
Sample
fwGanttChart1.setTasksColor("7","#ffff00");
setTrendLine( trendLine )
Adds a vertical line which can be used as a starting or ending point.
Parameter
nametyperequireddescription
trendLineObjectY
Sample
var info = { "line":[{"start":"07/09/2015","displayValue":"Start Point","color":"ff0000","thickness":"2","dashed":"1"}] }; fwGanttChart1.setTrendLine(info);
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
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.)