hello gurus, i was trying to plot a trend line chart using the subject module. everything is working except when i have more than 1000 data to plot, im getting: Template error: undef error - WHILE loop terminated (> 1000 iterations) i wonder if this is a limitation or if there is any workaround for me to be able to still generate the line chart with more than 1K data.

The Template Toolkit uses a failsafe counter to prevent runaway WHILE loops which would otherwise never terminate. If the loop exceeds 1000 iterations then an undef exception will be thrown, reporting the error:

WHILE loop terminated (> 1000 iterations)

The $Template::Directive::WHILE_MAX variable controls this behaviour and can be set to a higher value if necessary.

Another question: How do I change the color of the line graph in GD::Graph::Lines? I tried to add black RGB(0,0,0) but can't figure out how to set/call that color to be the color of the line graph. it always uses red.

If you look at the documentation you'll see the value of dclrs should be an array reference not a scalar. This is in order to potentially support multiple lines each of a different colour:

Quote

This controls the colours for the bars, lines, markers, or pie slices. This should be a reference to an array of colour names as defined in GD::Graph::colour (perldoc GD::Graph::colour for the names available).