Commit 57ee161c authored by Mario Chirinos's avatar Mario Chirinos

chart

parent 8767a711
......@@ -134,23 +134,23 @@
{
label: "{{d.label}}",
url: "{{d.url}}",
value: "{{d.value}}"
value: "{{d.value}}"
},
{% endfor %}
],
resize: true
}).on('click', function(i, row){
}).on('click', function(i, row){
console.log(1,row);
document.location.href = "{% url 'news-list'%}?"+row.url;
});
new Morris.Area({
element: 'morris-area-chart',
data: [
element: 'morris-area-chart',
data: [
{% for hh in histogram %}
{
date:"{{hh.date}}",
{% for key,value in hh.data.items %}
{% for key,value in hh.data.items %}
{{key}}:{{value}},
{% endfor %}
}{% if not forloop.last %},{% endif %}
......
......@@ -224,6 +224,7 @@ def index(request):
histogramsData = [ { "date":d["day"].strftime("%Y-%m-%d"), "data":{ "total": d["count"]}} for d in dateCount ]
histogramsLabels = ["total"]
# return render(request,'index.html',{"form":form, "info":info, "donutChart":{}, "histogram": {}, "histogramsLabels":{}})
print(donutChart)
return render(request,'new/index.html',{"form":form, "info":info, "donutChart":donutChart, "histogram": histogramsData, "histogramsLabels":histogramsLabels})
#-------------------------------------------------------------------------------
def publisherList(request, type="all"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment