Writting multiple sin wave plot

hi guys im new to influxdb, i was trying to generate a sin wave on influxdb, then i wonder if i could make multiple of it. here is my code:

from influxdb import InfluxDBClient

import time

import random

import math

USER = ‘root’

PASSWORD = ‘root’

DBNAME = ‘mydb’

HOST = ‘localhost’

PORT = 8086

dbclient = None;

def main():

dbclient = InfluxDBClient(HOST, PORT, USER, PASSWORD, DBNAME)

while True:
     for X in range(0, 360):
            sin = math.sin(X)
            data_point = getSensorData(sin)

            dbclient.write_points(data_point)

            print("Written data" +str(sin))

            time.sleep(2)

def getSensorData(sin):
sensorData = sin

now = time.gmtime()

pointValues = [

   {

      "time": time.strftime("%Y-%m-%d %H:%M:%S", now),

      "measurement": 'reading',

      "tags": {

          "nodeId": "node_1",

      },

      "fields": {

          "sin value": sensorData

      },

   }

]



return(pointValues)

if name == ‘main’:

main()
  1. You haven’t said what the problem is - what are we trying to help you deal
    with?

  2. Most sin() functions I’m familiar with expect the argument in radians, not
    degrees. Have you checked for this library?

Antony.

thanks for the reply antony,
im just trying to write a python programm into influxdb which will display a sin wave on grafana, with code that iv shown is able to display a single sin wave, so i wonder if there is a way to display multiple sin waves on grafana by modifying the python code

Hello @yoshino1204,
You might find this useful: