In this article
CDL formulas enhance dataGrid, chart, and headline widgets, enabling specific data manipulations using simple value identifiers for various display elements.
Formulas from the Tabular Engine can be used in CDL to support various widgets including dataGrid, chart, and headline (canvas). This is done by using the following CDL:
Data Grid Widget
//dataGrid
valueId[ row = /myRow1, column = /myColumn1 ] //particular cell
valueId[ row = /myRow1 ] //paticular row, the same column
valueId[ column = /myColumn1 ] //paticular column, the same row
valueId[ ] //the same cell
Chart Widget
//chart
valueId[ category = /myCategory1, series = /mySeries1 ] //particular dataPoint
valueId[ category = /myCategory1 ] //paticular category, the same series
valueId[ series = /mySeries1 ] //paticular series, the same category
valueId[ ] //the same datapoint
Headline (canvas widget)
//headline (canvas)
valueId[ tile = /myTile1 ] //partiular tile
valueId[ ] //the same tile
ValueId
In most cases valueId is just “value” (e.g. cell { value: avg(q1) tile { value: avg(q1) } series { value: avg(q1) }).
To simplify CDL, if valueId that should be referenced is “value” then it can be omitted.
widget ANY{
//both are the same
value[ ...some coordinates... ]
[ ...some coordinates... ]In case of headline (canvas) we expect only tile as a coordinate, so we can make further simplification
widget headline | canvas {
//all are the same
value[ tile = /myTile ]
[ tile = /myTile ]
[ myTile ]All this would allow us to define formulas like this:
column #total { //datagrid
cell {
value: formula {
value: [column = /col1] + [column = /col2]
}
}
}
series #average { //chart
value: formula {
value: avg( [series = /ser1], [series = /ser3] )
}
}
tile value #difference { //headline (canvas)
value: formula {
value: [/tile1] - [/tile2]
}
}