This feature is available since v5.6.0
Sometimes there is a need to tune a data for particular chart. In those cases you can use data transformation feature to cover following needs:
Convert dates to browses locale.
Create additional dimensions with complex calculations.
Add new rows to data or remove unneeded.
Data transformation is available only for advanced chart gadget.
Example usage of data transformation
Consider a query of min, max and average comments length per day which we want to visualize as a plot in Jira. For this need we want to create a new view with following steps:
Go to Smart QL → New query and place following query
SELECT floor(created to day) creationday, max(CHAR_LENGTH(body)) maxcommentlength, avg(CHAR_LENGTH(body)) avgcommentlength, min(CHAR_LENGTH(body)) mincommentlength FROM CORE.comments GROUP BY floor(created to day)
{ "type": "line", "x": "X", "y": "Y", "color":"C", "plugins": [ { "name": "tooltip" }, { "name": "legend" }, { "name": "export-to" } ] }
data => data.reduce((acc, curr)=>[ ...acc, {X: curr.creationday, Y: curr.maxcommentlength, C: 'max'}, {X: curr.creationday, Y: curr.mincommentlength, C: 'min'}, {X: curr.creationday, Y: curr.avgcommentlength, C: 'avg'} ], [])