This guide outlines how to install Grafana and connect it to the InfluxDB database to visualize historical stock market data.
- Download from: https://grafana.com/grafana/download
- Extract and run
grafana-server.exe. - Open
http://localhost:3000in a browser. - Default login:
admin/admin(you’ll be prompted to change it).
sudo apt install -y software-properties-common
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
sudo apt update
sudo apt install grafana
sudo systemctl start grafana-server-
Go to Settings > Data Sources in Grafana.
-
Choose InfluxDB as the data source.
-
Enter:
- URL:
http://localhost:8086 - Database(Bucket):
stock_price - Auth Token (or username/password if InfluxQL)
- URL:
-
Click Save & Test.
- Add new panel: Visualize
stock_priceby ticker. - Example query:
from(bucket: "stock_price")
|> range(start: -30d)
|> filter(fn: (r) => r._measurement == "stock_price")
- Real-time graphing of prices and volume
- Ticker-based filtering
- Export options (CSV/PNG/PDF)
Once all the InfluxDB data upload scripts have been executed and your database is populated, you can import the prebuilt Grafana dashboard for this project:
-
In Grafana, go to + > Import.
-
Upload the file
Stock Market Prediction-1731762228187.json. -
When prompted:
- Set the data source to the InfluxDB instance you configured (ensure the name matches).
-
Click Import.
This will load a ready-to-use dashboard tailored for stock market data visualization.
Ensure InfluxDB is running before launching Grafana. Use dashboard export/import to reuse panel layouts and backup configurations.