I have successfully coded several stacked column charts with no problem, all having a similar structure shown in the snippet below:
arr.push(['Date', 'Item1', 'Item2', 'Item3', 'Item4', 'Item5']); for (let i = 0; i < elementCount; i++) { arr.push ( [ jsonData[i].date, Number(jsonData[i].item1), Number(jsonData[i].item2), Number(jsonData[i].item3), Number(jsonData[i].item4), Number(jsonData[i].item5) ] ); } var data = new google.visualization.arrayToDataTable(arr); When I execute the above code, I get several stacked columns (by date) where each column is comprised of several stacks representing the values associated with item1-item5 in the array. The item count is fixed and I know the name of each item to be displayed in the legend in advance (i.e. the chart has a legend showing "Item1", "Item2", ..., "Item5" as defined in my initial *arr.push* statement. All good... Now I am trying to do something seemingly very similar however I do not know in advance the number or names of different items comprising any one stacked column. The items are being read from a database and for one column there may be only one "stack" item and for another there may be 5 "stack" items. I suspect I'm overthinking things here and I welcome anyone to point out what should be obvious to me. Thanks in advance for any-and-all assistance. Lloyd -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/26f194f8-0374-481e-8045-2f0e37931470n%40googlegroups.com.