Skip to content

Fix HighChart import error#3

Merged
j4ys0n merged 1 commit into
mainfrom
claude/review-msquant-context-011CUkVRVR6GHo7Q6qiPVgfk
Nov 3, 2025
Merged

Fix HighChart import error#3
j4ys0n merged 1 commit into
mainfrom
claude/review-msquant-context-011CUkVRVR6GHo7Q6qiPVgfk

Conversation

@j4ys0n
Copy link
Copy Markdown
Contributor

@j4ys0n j4ys0n commented Nov 3, 2025

Root cause: The nicegui-highcharts package does not export a HighChart class. Instead, it extends NiceGUI by adding ui.highchart() to the ui namespace.

Changes:

  • Removed incorrect import: from nicegui_highcharts import HighChart
  • Changed all HighChart() calls to ui.highchart()
  • Updated .context/IMPLEMENTATION_FIXES.md to reflect correct usage

This fixes the ImportError:
cannot import name 'HighChart' from 'nicegui_highcharts'

The correct usage is to install nicegui-highcharts (already in pixi.toml), which automatically adds the highchart element to NiceGUI's ui namespace.

Tested:

  • Ruff lint: passed
  • Python syntax check: passed
  • Code follows NiceGUI highcharts plugin documentation pattern

Root cause: The nicegui-highcharts package does not export a HighChart class.
Instead, it extends NiceGUI by adding ui.highchart() to the ui namespace.

Changes:
- Removed incorrect import: from nicegui_highcharts import HighChart
- Changed all HighChart() calls to ui.highchart()
- Updated .context/IMPLEMENTATION_FIXES.md to reflect correct usage

This fixes the ImportError:
  cannot import name 'HighChart' from 'nicegui_highcharts'

The correct usage is to install nicegui-highcharts (already in pixi.toml),
which automatically adds the highchart element to NiceGUI's ui namespace.

Tested:
- Ruff lint: passed
- Python syntax check: passed
- Code follows NiceGUI highcharts plugin documentation pattern
Copilot AI review requested due to automatic review settings November 3, 2025 15:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the monitor page to use the NiceGUI plugin-based API for Highcharts instead of direct imports. The change migrates from importing nicegui_highcharts.HighChart to using the ui.highchart() method that becomes available after the nicegui-highcharts plugin is installed.

  • Removed direct import of HighChart from nicegui_highcharts
  • Replaced all HighChart() constructor calls with ui.highchart() method calls
  • Updated documentation to reflect the plugin-based approach

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/msquant/app/pages/monitor.py Migrated from direct HighChart import to plugin-based ui.highchart() API; removed trailing whitespace
.context/IMPLEMENTATION_FIXES.md Updated documentation to reflect plugin-based Highcharts usage and removed references to graceful fallback pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j4ys0n j4ys0n merged commit 5ddab1e into main Nov 3, 2025
7 checks passed
@j4ys0n j4ys0n deleted the claude/review-msquant-context-011CUkVRVR6GHo7Q6qiPVgfk branch November 3, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants