After gathering responses from users in a JSON format using SurveyJS, I have data like this:
var surveyJSON = {pages:[{name:"page1",elements:[{type:"rating",name:"How confident are you conducting market analysis?",description:"5 - most confident"},{type:"rating",name:"How confident are you evaluating the feasibility of a new opportunity?",description:"5 - most confident"},{type:"rating",name:"How confident are you discovering new ways to improve existing products?",description:"5 - most confident"}]},{name:"page2",elements:[{type:"rating",name:"How confident are you targeting new markets and customers?",description:"5 - most confident",isRequired:true},{type:"rating",name:"How confident are you reacting quickly to take advantage of business opportunities?",description:"5 - most confident",isRequired:true},{type:"rating",name:"How confident are you creating new products and services and/or developing new ideas?",description:"5 - most confident"}]}]}
Now, I want to generate individual charts for each page of responses using HighCharts. Each Page corresponds to a unique chart - how do I achieve this when the number of pages is dynamic?
I currently have a HighCharts implementation that displays all responses in one chart, but that's not what I need:
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'Your confidence levels'
},
xAxis: {
categories: titleArray,
},
yAxis: {
title: {
text: 'Your confidence levels',
align: 'high'
}
},
series: [{
data: valuesArray
}]
});