ismail751
Posts: 1
Joined: Tue Aug 03, 2021 8:05 am

Loop Gantt Charts?

How to loop Gant charts it show the error ""Uncaught SyntaxError: Unexpected token 'for'"" below is the code
series: [{
data: [
for(var x=0;x<activities.length;x++)
{
title: activities[x].title,
budget: activities[x].budget,
target: activities[x].total_target,
start:Date.UTC(2017, 10, 23),
end: Date.UTC(2018, 10, 23),
y: x
},
}
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Loop Gantt Charts?

Hello ismail751!

Welcome to our forum and thanks for contacting us with your question!

Data is the place for the array of points for the series. It's not a place where you can write JS code.

You can pass your data above the chart for example like that: https://jsfiddle.net/BlackLabel/L2b7zo05/

Best regards!
Dominik Chudy
Highcharts Developer
JanWatson
Posts: 1
Joined: Fri Aug 13, 2021 12:22 pm

Re: Loop Gantt Charts?

dominik.c wrote: Wed Aug 04, 2021 8:36 am You can pass your data above the chart for example like that: https://jsfiddle.net/BlackLabel/L2b7zo05/
Thanks for the tip. Even though I came in with another question. Your hint was very helpful to me. Thanks again.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Loop Gantt Charts?

That's great to hear!

In case of any further questions, feel free to contact us again.
Dominik Chudy
Highcharts Developer

Return to “Highcharts Gantt”