Hi,
I’m trying to create a chart line (or scatter) with 2 series from Django data.
I don’t understand how I can implement a data object from Django to ithe dhtmlxChart in HTML file ?
For exemple, I would like to use this kind of dataset in Django side :
y1_series= [0, 1, 1, 2, 3, 5, 8, 13, 21]
x1_series= [0, 1, 2, 3, 4, 5, 6, 7, 8]
y2_series= [10, 20, 30, 40, 50, 60, 70, 80, 90]
x2_series= [0, 1, 2, 3, 4, 5, 6, 7, 8]
Today I use this code to send dataset (django side) to html code:
return render(request, '.../MyPage.html', {'y1' : y1_series, 'x1' : x1_series, 'y2' : y2_series, 'x2' : x2_series})
In html code I get my dataset like this (and it works) :
var y1series = {{ y1 }}
var x1series = {{ x1 }}
var y2series = {{ y2 }}
var x2series = {{ x2 }}
But, in Html side, how can I implement it in dhtmlXChart (value and/or parse)
I study and try to modify code in these 2 links without success :
dhtmlx.com/docs/products/dhtmlx … _init.html
dhtmlx.com/docs/products/dhtmlx … eries.html
Have you any idea why I can’t do it (formatted issue data from Django) ?
Thanks for your reply