{% if chart is defined %} {% if chart.points %} g {% for y, grams in chart.grams %} {{ "{:,}".format(grams) }} {% endfor %} {% if chart.points|length > 1 %} {% endif %} {% for x, day in chart.dates %} {{ day }} {% endfor %} {% for point in chart.points %} {%- set weight = "{:,}".format(point.grams) ~ " g" %} {{ point.day }} {{ weight }} {% endfor %} {% endif %} {% elif points %} {# 稼働中の旧プロセスがテンプレートだけを読み直したときも、従来のグラフを表示する。 #} {% for x,y in points %}{% endfor %} {{ bounds[0] }}{% if bounds[0] != bounds[1] %} 〜 {{ bounds[1] }}{% endif %} {% endif %}