Industrial Alarm Monitoring Application with LightningChart Python
Tutorial
Assisted by AI
Learn how to create a Python industrial alarm monitoring application with real-time and high-performance charts.
Introduction to the Project
In the industrial field, we always have a huge amount of data through different events like alarms. It is crucial for them to monitor these events to maintain standards, detect anomalies and keeping everything safe. This article demonstrates an industrial alarm monitoring application using LightningChart Python to visualize static and real-time streaming alarm data through different charts and dashboards.
LightningChart Python
LightningChart Python is a powerful visualization library that is capable of visualizing real-time and interactive charts with large datasets efficiently. For this project, LightningChart provided visual insight into alarm severity, machine learning analysis and uncertainty bands through different interesting charts like line series, heatmaps, stacked bar charts, bubble charts, pie chart and 3D area chart.
Setting Up Python Environment
Before running the project, install Python and the other required libraries using:
pip install pandas numpy scikit-learn xgboost shap lightningchart smote-variants
Several Python libraries were employed in this article:
- Pandas: For loading, cleaning, and structuring data..
- NumPy: For numerical operations.
- Scikit-learn: Provided machine learning tools like XGBoost for classification, SMOTE for handling imbalanced datasets, Isolation Forest for anomaly detection, and RobustScaler for data normalization.
- LightningChart: To create interactive visualizations.
Setting Up Your Development Environment
- Set up a virtual environment:
python -m venv env
source env/bin/activate # On Windows use `env\Scripts\activate`
- Use Visual Studio Code (VSCode) for a streamlined development experience.
Visualizing Data with LightningChart Python
Here are some examples codes and charts that shows how we created key visualizations:
Real-Time Alarm Prediction with XGBoost
In the first row of dashboard, we can see real time prediction chart, it first starts predicting two values and connect them with the red line. after a few seconds it would show actual values with yellow line and at the same time model turns the old red line to orange and start predicting two new values and connecting them. In the right side we have alarm counter and below it we can see level of alarm severity. In the second row we can see the real-time certainty heatmap.
xgb_model = XGBClassifier(random_state=42, use_label_encoder=False, eval_metric='logloss')
xgb_model.fit(X_train_clean, y_train_clean)
y_pred = xgb_model.predict(X_test)
Ensemble Model & Uncertainty Visualization
Here in this dashboard, we can see uncertainty chart for different classes.
seeds = [42, 123, 999, 31415, 2718]
models_list = []
for seed in seeds:
model_ens = XGBClassifier(random_state=seed, subsample=0.8, colsample_bytree=0.8)
model_ens.fit(X_boot, y_boot)
models_list.append(model_ens)
Exploratory Data Visualization Dashboard
Charts in dashboard focus on showing alarm severity in different ways. We have alarm severity distribution in pie chart, stacked bar charts show alarm class distribution, heatmap demonstrates alarms by day and hour, bubble chart showing severity over time and 3D surface chart displaying alarm frequency by day of week and hour.
severity_counts = df["AlarmSeverityName"].value_counts()
pie_chart.add_slices([{'name': sev, 'value': int(count)} for sev, count in severity_counts.items()])
Conclusion
This project demonstrates how we could use LightningChart Python to visualize and monitor industrial alarm data. This approach gives us a powerful insight into system behaviors, alarm severity levels, and maintenance needs. Benefits of LightningChart Python specifically in this project include:
- Real-time visualization capabilities allowing live monitoring.
- Versatile chart options facilitating detailed and multi-dimensional data analysis.
- High-performance rendering suited for complex and large datasets specially in industrial environments.
Continue learning with LightningChart
Best TradingView Charting Library Alternative
TradingView's charting libraries are the most visible option for fintech developers. Visibility is not the same as capability. This guide is for developers who have hit the wall on candle count limits, watermark restrictions, branding requirements, real-time...
Which JavaScript Chart Library Do AI Coding Agents Actually Recommend, and Does It Matter?
In this article Why AI coding agents have strong library preferences What the defaults actually are (and the data behind them) When the defaults work fine When they quietly fail you What to do instead: giving your agent better information The keyword angle nobody is...
How to Set Up LightningChart JS in Cursor and Claude Code Using MCP, in Under 5 Minutes
A step-by-step guide to installing the LightningChart JS MCP server so your AI coding agent stops hallucinating chart APIs and starts writing production-ready code from the first prompt. AI coding agents are good at writing chart code. They are less good at writing...

