Highcharts Encoding Tests
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
var chart = $('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Highcharts апапапап Text Encoding Tests'
},
xAxis: {
categories: [
'< not specified >',
'dogs < 6kg and cats > 4kg',
'< not specified>',
'&',
'&',
'\u003c \u0026 \u2244',
'& lt;'
],
},
series: [{
data: [
{ name: "< not specified> is treated as a tag and not rendered at all"},
{ name: "ditto the bits between the angle brackets in dogs < 6kg and cats > 4kg" },
{ name: "encoding the left angle bracket encodes the text" },
{ name: "an ampersand doesn't need to be encoded" },
{ name: "the html entity & is rendered literally" },
{ name: "Encoding characters like \\u003c, \\u26 or \\u2244 is fine" },
{ name: "I can't find any way to write out & lt; (or & gt;) without putting a space amongst it" }
]
}],
yAxis: {
min: 0,
labels: {
overflow: 'justify'
},
title: { enabled: false }
},
plotOptions: {
bar: {
dataLabels: {
crop: false,
enabled: true,
format: '{point.name}'
}
}
},
legend: {
enabled: false
}
}).highcharts();
chart.setTitle(null, { text: "dogs < 6kg and cats >...