#๐Ÿ”’ how do i plot an influxdb query?

5 messages ยท Page 1 of 1 (latest)

wintry hamlet
#

i managed to query the data i need but how do i plot it?
the tutorial i found loads data from a link and i dont think i could do that here
code so far

from typing import NamedTuple

from influxdb import InfluxDBClient
from influxdb.resultset import ResultSet

import pandas as pd
import matplotlib.pyplot as plt

INFLUXDB_ADDRESS = 
INFLUXDB_USER = 
INFLUXDB_PASSWORD = 
INFLUXDB_DATABASE = 

client = InfluxDBClient(INFLUXDB_ADDRESS, 8086, INFLUXDB_USER, INFLUXDB_PASSWORD, INFLUXDB_DATABASE)

rs: ResultSet = client.query("SHOW MEASUREMENTS")

print(rs.raw)
'battery'
'humidity'
'temperature'
query = 'SELECT * FROM temperature WHERE time >= now() - {start}d'

rs: ResultSet = client.query(query.format(start=input()))

print(rs.raw["series"]["columns"])
chilly eagleBOT
#

@wintry hamlet

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wintry hamlet
#

!solved

chilly eagleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.