As we recalled in previous releases, when a chart was created in Einstein Analytics(EA), measures and dimensions were automatically assigned to the chart widget. For example for a chart with one measure and one dimension, EA will assign the first measure to be the x axis and the second measure to be y axis as a simple example. This limitation created some challenges when creating EA charts as there was not much flexibility for users/developers to control what to display for each part of the chart.
A new feature called columnMap has been introduced as part of the EA Spring ‘18 release. This new feature promises to bring more flexibility to EA charts as it will allow users to control and display the different measures and dimensions on different parts of the chart as well as the ability to support more complex charts. This new feature will be added for all new charts as a construct to the json and will look something like the following:
“columnMap“: {
“trellis”: [],
“plots”: [
“count”
],
“dimensionAxis”: [
“Region”,
“Country”,
“Has_Ultrasound”
]
},
While the new feature comes with a lot of nice functionality to make charts configuration more powerful, there is one limitation users/developers will face and that is that this columnMap feature is non bindable. Meaning that if you need to add a static step to allow your users to nicely and dynamically toggle between two options such as Region and Country, the chart will not work.
However there is a way around this non binding limitation to make binding work for newly created charts in this new EA Spring ‘18 release. The approach consists in replacing the columnMap section of the chart with the empty array “columns”:{}.
Replace the columnMap section of the chart
“columnMap“: {
“trellis”: [],
“plots”: [
“count”
],
“dimensionAxis”: [
“Region”,
“Country”,
“Has_Ultrasound”
]
},
With the following configuration
“columns“: {}
By applying this configuration change, the column mapping will be generated dynamically based on your query definition. In the following example we are using a static binding to toggle between countries and regions on a newly created chart.
Dimension values are dynamically updated as the user selects the two options.
By using this approach you should be able to allow dynamic binding on new charts created in the new release EA Spring ‘18. It is on the plans to allow support to define customizations to the column map construct in future releases by using declarative UI instead of bindings.