我有一个查询集,显示每月每天的关注者数量
视图:
context["brandtwitterFollowerCounts"] = (
TwitterFollowerCount.objects.filter(
twitter_account=self.object.twitter_account, followers__gt=0
)
.distinct("created__date")
.order_by("created__date")
)
context["brandTwitterFollowCreated"] = [
i.created.strftime("%d %m") for i in context["brandtwitterFollowerCounts"]
]
context["brandTwitterFollowers"] = [
i.followers for i in context["brandtwitterFollowerCounts"]
数据集:
var newDataObjectTwo = {
labels: {{ brandTwitterFollowCreated|safe }},
datasets: [{
label: 'Daily',
backgroundColor: 'rgb(255, 255, 255)',
fill: false,
borderColor: 'rgb(29, 161, 242)',
data: {{ brandTwitterFollowers|safe }}
}],
}
我想过滤这个月,而不是现在。因此,由于目前有3个月(08、09、10),图表应该只显示3个数据点。抱歉,如果这不合理,我不知道什么是最好的解释方式
目前没有回答
相关问题 更多 >
编程相关推荐