-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat(widgets): add polar chart #9271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi 👋, thank you for your PR! We've run benchmarks in an emulated environment. Here are the results: ARM Emulated 32b - lv_conf_perf32b
Detailed Results Per Scene
ARM Emulated 64b - lv_conf_perf64b
Detailed Results Per Scene
Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode. 🤖 This comment was automatically generated by a bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 6 files
|
now the skeleton builds. |
|
Perhaps you should add a new example code. |
|
I'm not sure if the example code is the first task to do. I had added "polar chart" inside "chart" folder, but I wonder if a better approach would be having a separate "polarchart" folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 issues found across 14 files (reviewed changes from recent commits).
Prompt for AI agents (all 7 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="examples/widgets/polarchart/lv_example_polarchart_8.c">
<violation number="1" location="examples/widgets/polarchart/lv_example_polarchart_8.c:16">
The third gap point again writes to (s + 2) % p, leaving only two distinct points cleared instead of three; use a different offset for the third assignment so the gap actually spans three points.</violation>
</file>
<file name="examples/widgets/polarchart/index.rst">
<violation number="1" location="examples/widgets/polarchart/index.rst:3">
The underline under “Line Polarchart” is shorter than the title, which makes Sphinx fail with “Title underline too short.” Extend the underline to match the heading length.</violation>
<violation number="2" location="examples/widgets/polarchart/index.rst:16">
This section underline is shorter than its title, so Sphinx/docutils rejects the file. Make the underline at least as long as the heading text.</violation>
<violation number="3" location="examples/widgets/polarchart/index.rst:28">
The underline beneath “Scatter polarchart” is too short for the heading, breaking the RST structure. Extend it to at least the heading length.</violation>
<violation number="4" location="examples/widgets/polarchart/index.rst:34">
The underline below “Circular line polarchart with gap” is shorter than the title, which makes the RST invalid. Increase the underline length to match the heading.</violation>
</file>
<file name="tests/src/test_cases/xml/test_xml_polarchart.c">
<violation number="1" location="tests/src/test_cases/xml/test_xml_polarchart.c:32">
This test is supposed to build a polar chart but asks lv_xml_create for "lv_chart", so the parser constructs a regular cartesian chart and later lv_polarchart_* calls operate on the wrong object type, causing LV_ASSERT failures.</violation>
<violation number="2" location="tests/src/test_cases/xml/test_xml_polarchart.c:41">
Axis attributes are routed through the regular chart parser (`lv_chart-axis`), which calls lv_chart_set_axis_* on the parent. A polar chart requires the `lv_polarchart-axis` tag so its own axis setters run; otherwise the XML attributes are ignored or trigger asserts.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files (reviewed changes from recent commits).
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="docs/src/details/widgets/polarchart.rst">
<violation number="1" location="docs/src/details/widgets/polarchart.rst:382">
The new include points to ../../examples/widgets/polarchart/index.rst, but that file doesn’t exist in the repo, so the documentation build will error.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| Example | ||
| ******* | ||
|
|
||
| .. include:: ../../examples/widgets/polarchart/index.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new include points to ../../examples/widgets/polarchart/index.rst, but that file doesn’t exist in the repo, so the documentation build will error.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/src/details/widgets/polarchart.rst, line 382:
<comment>The new include points to ../../examples/widgets/polarchart/index.rst, but that file doesn’t exist in the repo, so the documentation build will error.</comment>
<file context>
@@ -380,7 +379,7 @@ No *Keys* are processed by Chart Widgets.
*******
-.. include:: ../../examples/widgets/chart/index.rst
+.. include:: ../../examples/widgets/polarchart/index.rst
</file context>
@kisvegabor I did it (a mock as a starting point for the implementation). |
|
Hey, |
I wrote from the beginning that I only wrote mocks. Do you need me to change the png files in the tests to show the appearance of what I expect in the several tests? |
There was a problem hiding this 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 adds a new polar chart widget to LVGL, providing functionality to display data in polar coordinates with support for line and scatter chart types. The implementation includes comprehensive test coverage, XML parsing support, theme integrations, and multiple examples.
Key Changes
- New polar chart widget implementation with API for series management, cursor support, and data visualization
- XML parser support for declarative polar chart creation
- Integration with all three existing themes (default, simple, mono)
- Comprehensive test suite including unit tests, performance tests, and XML tests
- Multiple usage examples demonstrating various polar chart features
Reviewed changes
Copilot reviewed 32 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/polarchart/lv_polarchart.h | Public API header defining polar chart types, functions for chart creation, series management, and data manipulation |
| src/widgets/polarchart/lv_polarchart_private.h | Private header with internal data structures for polar chart, series, and cursor |
| src/xml/parsers/lv_xml_polarchart_parser.c | XML parser implementation for polar chart widget and its sub-components |
| src/xml/parsers/lv_xml_polarchart_parser.h | XML parser API declarations |
| src/xml/lv_xml.c | Registration of polar chart XML parsers |
| src/themes/default/lv_theme_default.c | Default theme styling for polar chart widget |
| src/themes/simple/lv_theme_simple.c | Simple theme styling for polar chart widget |
| src/themes/mono/lv_theme_mono.c | Monochrome theme styling for polar chart widget |
| src/lv_conf_internal.h | Configuration macro for enabling polar chart widget |
| lv_conf_template.h | Template configuration option for polar chart |
| lvgl.h | Main header inclusion of polar chart public API |
| lvgl_private.h | Private header inclusion for internal access |
| src/misc/lv_types.h | Type definitions for polar chart structures |
| tests/src/test_cases/widgets/test_polarchart.c | Comprehensive unit tests for polar chart functionality |
| tests/src/test_cases/xml/test_xml_polarchart.c | XML parsing and rendering tests |
| tests/src/test_cases_perf/test_polarchart.c | Performance benchmark tests |
| tests/src/lv_test_perf_conf.h | Performance test configuration |
| examples/widgets/polarchart/*.c | Example implementations demonstrating various polar chart features |
| examples/widgets/lv_example_widgets.h | Example function declarations |
| docs/src/details/widgets/index.rst | Documentation index entry |
| configs/ci/perf/lv_conf_perf64b.defaults | CI performance test configuration |
| env_support/cmsis-pack/lv_conf_cmsis.h | CMSIS pack configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
see #7369