-
-
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. |
|
-
-
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.
-
-
Returns:
Type |
Description |
string
|
Human readable message, which DataProviders, this DataProvider depends on, are not currently in ready state |
-
-
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. |
-
-
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'
-
-
Not implemented for Chart
Returns:
null
-
-
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. |
-
-
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). |
-
-
Not implemented for Chart
Returns:
null
-
-
Getter for the ready status of the instance. This status is a final state
defined by each sub-class which is reached when the process has finished
normally.
Returns:
Type |
Description |
bcdui.core.Status
|
The status object indicating that the process belonging
to this class is finished. |
-
-
Getter for the status of this object. See
bcdui.core.status for possible return values.
Returns:
-
-
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:
-
-
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. |
-
-
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 |
-
-
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
-
-
-
-
-
-
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. |