[Chartjs]-Chart JS title passed from Django โ€“ issue with apostrophe &#39

1๐Ÿ‘

OK, I found the answer was to use escapejs:

text: '{{ chart_row.heading_2|escapejs }}'

From the doc: Django built-in template tags

0๐Ÿ‘

Try rendering the title as safe.

options: {
    title: {
        display: true,
        text: '{{ chart_row.heading_2|safe }}'
    }
}

Leave a comment