Pass data in np.dnarray to Highcharts
- by F.N.B
I'm working with python 2.7, jinja2, flask and Highcharts. I create two numpy array (x1 and x2, type = numpy.dnarray) and I pass to Highcharts. My problems is, Highcharts don't recognize the commas in the vector.
This is my jinja2 code:
<script>
$(function () {
$('#container').highcharts({
series: [{
name: 'Tokyo',
data: {{ x1 }}
}, {
name: 'London',
data: {{ x2 }}
}]
});
});
And this is the error that I look with network chrome dev tools:
series: [{
name: 'Tokyo',
data: [1 4 5 2 3]
}, {
name: 'London',
data: [3 6 7 4 1]
}]
I need change the numpy array to python list to pass to Highcharts or there is a better way to do?? Thanks