`
category = [{'name': '权益', 'y': 46.089999999999996}, {'name': '债券', 'y': 25.029999999999998}, {'name': '货币', 'y': 0.0}, {'name': '另类', 'y': 15.37}, {'name': 'QDII', 'y': 0.0}, {'name': '其他', 'y': 0.0}]
'''
function initChart4(){
Highcharts.setOptions({"global": {useUTC: false}, "lang": {}});
var option = {
chart: {
type: 'area',
renderTo: "chart-4"
},
colors: ['#ff3030', '#7cb5ec'],
credits: {
enabled: false
},
legend: {
enabled: true
},
plotOptions: {
series: {
compare: "percent"
}
},
rangeSelector: {
selected: 3
},
title: {
text: "动态回撤",
align: "left",
style: {
fontSize: '15px'
}
},
tooltip: {
pointFormat: "<span style=\\"color:{series.color}\\"><b>{series.name}</b></span>: {point.y} ({point.change}%)<br/>",
valueDecimals: 2
},
yAxis: {
reversed: true,
offset: 25,
labels: {
formatter: function () {
return this.value + '%';
}
},
plotLines: [{
value: 0,
width: 0.05,
dashStyle: 'dot',
color: "silver"}]
}
};
var chart = new Highcharts.StockChart(option);
var data = %r;
var dataLen = data.length;
for (var ix = 0; ix < dataLen; ix++) {
chart.addSeries(data[ix]);
}
}
''' % category
`
ValueError: unsupported format character ')' (0x29) at index 1185