我在使用django-charit时遇到了一个问题,它使用了Highcharts。 到目前为止,我的代码是:
#creating chart
ds = DataPool(
series=
[{'options': {
'source': DataForecast.objects.all().order_by('id')},
'terms': [
'date_time',
'wl_observed_m',
'wl_forecasted_m']}
])
cht = Chart(
datasource=ds,
series_options=
[{'options': {
'type': 'line',
'stacking': False},
'terms': {
'date_time': [
'wl_observed_m',
'wl_forecasted_m']
}}],
chart_options=
{'title': {
'text': 'Forecast for January 19, 2014 2:00 PM'},
'xAxis': {
'title': {
'text': 'Date & Time'}},
'yAxis': {
'title': {
'text': 'Water Level, m.'}},
'credits': {
'enabled': False}})
结果是:
那么,如何更改标签(环绕)?对x轴进行排序。我试了一下,但没有成功。在
排序:}或按日期字段(打印到图表中的字段)而不是id对查询进行排序
DataForecast.objects.all().order_by('id')
使用.latest()
或{相关问题 更多 >
编程相关推荐