Your cookie preferences were saved
The stacked bar graph uses similar data sets to the "Simple Bar Chart", setting the following data in the helper variable field:
[ { "Person":"Janet", "Topping":"Mushrooms", "Amount":Number(helper.queryFieldValue("MUSHROOMS")) }, { "Person":"Janet", "Topping":"Onions", "Amount":Number(helper.queryFieldValue("ONIONS")) }, { "Person":"Janet", "Topping":"Olives", "Amount":Number(helper.queryFieldValue("OLIVES")) }, { "Person":"Janet", "Topping":"Courgette", "Amount":Number(helper.queryFieldValue("ZUCCHINI")) }, { "Person":"Janet", "Topping":"Pepperoni", "Amount":Number(helper.queryFieldValue("PEPPERONI")) }, { "Person":"John", "Topping":"Mushrooms", "Amount":Number(helper.queryFieldValue("MUSHROOMS2")) }, { "Person":"John", "Topping":"Onions", "Amount":Number(helper.queryFieldValue("ONIONS2")) }, { "Person":"John", "Topping":"Olives", "Amount":Number(helper.queryFieldValue("OLIVES2")) }, { "Person":"John", "Topping":"Courgette", "Amount":Number(helper.queryFieldValue("ZUCCHINI2")) }, { "Person":"John", "Topping":"Pepperoni", "Amount":Number(helper.queryFieldValue("PEPPERONI2")) }]
The addSeries property splits each bar by person.
helper.registerCustomFieldFn("BARCHART", "initChart", function(chart) { chart.addCategoryAxis("x", "Topping"); chart.addMeasureAxis("y", "Amount"); chart.addSeries("Person", dimple.plot.bar); chart.addLegend(60, 10, 500, 20, "right");});
Share this page
Print