You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
While using NVD3 and the examples available on this page I am not able to generate the graph, Nothng is generated. I am using Django 2.0, Python 3.6.3 and NVD3
Here is my view.py
def demo_linechart(request):
"""
lineChart page
"""
start_time = int(time.mktime(datetime.datetime(2012, 6, 1).timetuple()) * 1000)
nb_element = 150
xdata = range(nb_element)
xdata = map(lambda x: start_time + x * 1000000000, xdata)
ydata = [i + random.randint(1, 10) for i in range(nb_element)]
ydata2 = map(lambda x: x * 2, ydata)
I know it's old question, but maybe it will be useful for somebody else. Wrap the maps in list. Like that:
xdata = list(map(lambda x: start_time + x * 1000000000, xdata))
Do it both for xdata and ydata2. In my case it works.
Hi All,
While using NVD3 and the examples available on this page I am not able to generate the graph, Nothng is generated. I am using Django 2.0, Python 3.6.3 and NVD3
Here is my view.py
def demo_linechart(request):
"""
lineChart page
"""
start_time = int(time.mktime(datetime.datetime(2012, 6, 1).timetuple()) * 1000)
nb_element = 150
xdata = range(nb_element)
xdata = map(lambda x: start_time + x * 1000000000, xdata)
ydata = [i + random.randint(1, 10) for i in range(nb_element)]
ydata2 = map(lambda x: x * 2, ydata)
Below is the HTML
<script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.0/d3.min.js"></script> <script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.5/nv.d3.min.js"></script>{% load nvd3_tags %}
<script>{% load_chart charttype chartdata "linechart_container" extra %}</script> <script>{% include_container "linechart_container" 400 600 %}</script>Pls suggest what to do as nothing is displayed on the webpage
The text was updated successfully, but these errors were encountered: