1[%# This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 # 5 # This Source Code Form is "Incompatible With Secondary Licenses", as 6 # defined by the Mozilla Public License, v. 2.0. 7 #%] 8 9[% colsepchar = user.settings.csv_colsepchar.value %] 10 11[% data = chart.data %] 12Date\Series 13[% FOREACH label = chart.labels %] 14 [% colsepchar %][% label FILTER csv %] 15[% END %] 16[%# The data, which is in the correct format for GD, is conceptually the wrong 17 # way round for CSV output. So, we need to invert it here, which is why 18 # these loops aren't just plain FOREACH. 19 #%] 20[% i = 0 %] 21[% WHILE i < data.0.size %] 22 [% j = 0 %] 23 [% WHILE j < data.size %] 24 [% IF j > 0 %] 25 [% colsepchar %] 26 [% END %] 27 [% data.$j.$i %] 28 [% j = j + 1 %] 29 [% END %] 30 [% i = i + 1 %] 31 32[% END %] 33