Class: XmlChart

bcdui.component.chart. XmlChart

Implements XML-definition interface. Extends the JS implementation of the Chart class allowing an XML definition model as input.

new bcdui.component.chart.XmlChart(args)

Constructor of bcdui.component.XmlChart, called by prototype.
Name Type Description
args Object Parameter object
Name Type Default Description
targetHtml targetHtmlRef Where to place the chart
config bcdui.core.DataProvider Definition if the chat according to Model with the chart definition according to XSD http://www.businesscode.de/schema/bcdui/charts-1.0.0
suppressInitialRendering boolean false optional If true, the renderer does not initially auto execute but waits for an explicit execute
id string optional Page unique id for used in declarative contexts. If provided, the chart will register itself
showAxes boolean true optional If false, no axes will be shown
title string optional Title
suppressInitialRendering boolean false optional As every renderer, charts will execute and output itself automatically and their parameters after creation. This can be suppressed here.
width number optional Overwrite the chart's auto-width derived from targetHtml
height number optional Overwrite the chart's auto-height derived from targetHtml

Extends

Members

constantAREACHART

constantBARCHART

constantGAUGECHART

constantidstring

A globally unique id of the object. DataProviders do also register themselves at bcdui.factory.objectRegistry when an id is provided to the constructor. This id is only needed in declarative contexts, like jsp or, when a DataProvider is accessed in a xPath like . If not provided in the constructor, a random id starting with 'bcd' is set, but the object is not automatically registered.

constantLINECHART

constantMARIMEKKOCHART

constantPIECHART

constantPOINTCHART

constantsavedStatus

Example
if( model.getStatus() === model.savedStatus )
  ...

constantsaveFailedStatus

constantSCATTEREDCHART

Methods

Adds a data series to the chart
Name Type Description
args Object Parameter object
Name Type Default Description
yAxis1Or2 integer optional 1 for left and 2 for right axis
yData Array.<numeric> optional Data array or provide yDataInfo
yDataInfo DomNodeSet optional XML nodeset with data
sizeData Array.<numeric> optional 2nd value for scattered charts
xValues Array.<numeric> optional For x-y charts
chartType integer | string optional Either name or numeric value for chart type
rgb string optional Color
dashstyle string optional Dash style
baseColors Array.<string> optional Colors defining the tones of the generated colors, for example in case of a pie chart
caption string optional Series caption
width numeric optional Line width
onClick function | string optional Either a function or the name of a function
toSeriesPercentage boolean false optional If true, each value is represented by its percentage value of the full series.

inherited addStatusListener(args)

Listen for any status to be reached. For use cases with the ready status (by far the most common), see onReady() and onceReady() convenience functions.
Name Type Description
args function | StatusListener | AddStatusListenerParam Either a function executed on all status transitions or a parameter map AddStatusListenerParam

inherited debugIsWaitingFor(){string}

Returns:
Type Description
string Human readable message, which DataProviders, this DataProvider depends on, are not currently in ready state

inherited debugStatus(){string}

Returns:
Type Description
string Human readable message about the current state state
Executes the process implemented by the concrete sub-class.
Name Type Default Description
doesRefresh boolean true optional Set this parameter to "false" if this method should do nothing when the object is already in the ready status. The default is "true" meaning that the process is re-started when it is currently ready.

inherited fetchData(){Promise}

asynchronously fetch data for this data provider.
Returns:
Type Description
Promise resolving once data has been loaded, first argument is this instance
Example
new bcdui.core.SimpleModel("data.xml").fetchData().then((dp)=>{ console.info(dp.getData()); })
This informs modification listeners, registered via onChange(args), that a change set was completed and data is consistent again.
Example
// Use of data modification events
var model = new bcdui.core.StaticModel({ data: { value: 3 } });
model.execute();
model.onChange( function(m) {
  console.log(m.getData().value);
});
model.getData().value ++;
model.fire(); // console prints '4'
Returns:
definition DOM document

inherited abstractgetFailedStatus(){Array.<bcdui.core.Status>}

Getter for the list of error statuses of this class. This implementation returns an empty list.
Returns:
Type Description
Array.<bcdui.core.Status> The status objects corresponding to failures in the object's process.
Getter for the name of the data provider. This name is for example used to set parameters names of a bcdui.core.TransformationChain.
Returns:
Type Description
string The name of the data provider. This name should be unique within the scope it is used and is usually not globally unique (as the id).
Returns:
model that render to
Getter for the status of this object. See bcdui.core.status for possible return values.
Returns:
Type Description
bcdui.core.Status The current status.
Tests if the object has reached a failure status. These status codes are returned by the "getFailedStatus" method.
Returns:
Type Description
boolean True, if the object's process has failed.
True, if DataProvider is ready and there are no uncommitted write transactions, see isReady() and fire().
Returns:
Type Description
boolean
Tests if the current state is the readyStatus. This status is the same status as returned by "getReadyStatus".
Returns:
Type Description
boolean True, if the object is ready.

inherited onceReady(listenerObject)

Name Type Description
listenerObject function | OnceReadyParam Either a function to be called on ready status (i.e. onSuccess) or a parameter map OnceReadyParam. To listen for other states see addStatusListener()
Example
myModel.onceReady({onSuccess: myCallback, executeIfNotReady: true})

inherited onChange(listenerObject, trackingXPath)

Name Type Description
listenerObject function | OnChangeParam Either a function to be called after changes or a parameter map OnChangeParam. Listeners can be removed with removeDataListener()
trackingXPath string optional xPath to monitor to monitor for changes

inherited onReady(listenerObject)

Name Type Description
listenerObject function | OnReadyParam Either a function to be called on ready status (i.e. onSuccess) or a parameter map OnReadyParam. To listen for other states see addStatusListener()
Example
myModel.onReady({onSuccess: function(){ console.log("ready") }, executeIfNotReady: true, onlyFuture: true})
Convenience method for debugging showing data in a prompt for copy-and-paste

inherited removeDataListener(listenerObject)

Name Type Description
listenerObject string | function | RemoveDataListenerParam Either a listener function or id or a parameter map RemoveDataListenerParam. Listeners are added with onChange()

inherited removeStatusListener(args)

Name Type Description
args function | StatusListener | RemoveStatusListenerParam The listener to be removed. This can either be a function or a StatusListener or a parameter map RemoveStatusListenerParam.
Sends the current data to the original URL
Serialize dataprovider's data if available
Returns:
String containing the serialized data
Define series as being stacked
Name Type Description
args Object map with
Name Type Default Description
axis integer 1 for left axis 2 for right one
chartType integer | string Either name or numeric value for chart type
asPercent boolean optional Each series is calculated to its percentage of the sum if all series and shown as *100'%'
isStacked boolean true optional Whether to stack or not
Name Type Description
args Status
Defines x (horizontal) axis
Name Type Description
args Object Parameter object
Name Type Description
categories Array.<number> optional Distinct values, provide this or xValues
xValues Array.<number> optional Values for continuous axis for x-y charts
caption string optional Axis caption
unit string optional Unit like € or sec. If '%', values are shown as percent. Use '% ' to show percent without dividing by 100
layoutFlow string optional css value
Defines left y axis
Name Type Description
args Object Parameter object
Name Type Default Description
caption string optional Axis caption
unit string optional Unit like € or sec. If '%', values are shown as percent. Use '% ' to show percent without dividing by 100
layoutFlow string optional css value
minValueUser numeric optional User set axis min value. Only used when below lowest actual value
maxValueUser numeric optional User set axis max value. Only used when above highest actual value
showGrid boolean true optional If false, no horizontal grid is shown but only small lines next to the y-axis values
Defines right y axis
Name Type Description
args Object Parameter object
Name Type Description
caption string optional Axis caption
unit string optional Unit like € or sec. If '%', values are shown as percent. Use '% ' to show percent without dividing by 100
layoutFlow string optional css value
minValueUser numeric optional User set axis min value. Only used when below lowest actual value
maxValueUser numeric optional User set axis max value. Only used when above highest actual value
Debugging function showing a text for this class.
Returns:
Type Description
string A summary of the class.