Ich benutze Chartit in einem Django-Projekt. Ich habe ein Modelle (ReadingSensor) mit den folgenden Attributen:Erstellen Sie mehrere (zwei) Quelle mit Charts in Django
- id_sensor
- date_time
- Wert
I ein Liniendiagramm mit mehreren Linien für verschiedene id_sensors
zum Beispiel:
Für ein einzelnes Modell, das wir haben:
ds = DataPool(
series=
[{'options': {
'source': MonthlyWeatherByCity.objects.all()},
'terms': [
'month',
'houston_temp',
'boston_temp']}
])
cht = Chart(
datasource = ds,
series_options =
[{'options':{
'type': 'line',
'stacking': False},
'terms':{
'month': [
'boston_temp',
'houston_temp']
}}],
chart_options =
{'title': {
'text': 'Weather Data of Boston and Houston'},
'xAxis': {
'title': {
'text': 'Month number'}}})
Dokumentation: http://chartit.shutupandship.com/docs/
ich die Dokumentation konsultiert fand aber kein suggestives Beispiel, mir zu helfen. Kann mir jemand helfen?
bitte posten Sie Ihren Code! –
Ich habe jetzt hinzugefügt. Es tut uns leid – roliveira