Remove complex if else,

We can simply set the value of chart.show_legend by using a
jinja filter