Hi - I am testing the upgrade on some existing templates I have that use a lot of graphs. It seems as though none of my graphs work now. There is no error, just no showing. Is there an easy way to convert them so that they work with the upgrade? Will I have to redo all my graphs in all my templates?
I have done some reading and it looks like if I want a graph then I have to have detail tables otherwise I have edit my code every time. For example - I have this extraction and out of this extraction I actually have six graphs. It is not transactional data. The bolded tags below would be for one graph. So with this type of extraction, am I going to have to edit the script? I have tried using the graph wizard and its just not getting me the simple bar chart I previously had.
We did our best to make them backwardscompatible but also know this doesn’t for all scenarios (especially when they are scripted). Could you share your template and data with me?
To follow up our offline conversation and to help others, below a JavaScript code snippet (Connect Designer user script) to programmatically construct the chart and populate it with values of specific data fields (in this case take from the first record of your Longitudinal table.
In short:
First we populate an array with objects containing the values, labels and optionally set colors (each bar or segment can have its own). Subsequently we construct a chart object following the API of the amchart library documentation (which could also be copied from the online amchart editor, see: Online Chart Maker | amCharts)
The last line in our stringifies the chart object and writes it the data-amchart attribute on the Connect chart element.
We’ve added a new article to our How To section. It provides background information on how Connect renders Charts/Graphs and describes how to programmatically configure a Chart object: