Skip to content

Conversation

@Manahil-Afzal
Copy link
Contributor

While reviewing the Speed Gauge
example in the ECharts editor, it was observed that the detail text (value and unit) sometimes overlaps with the pointer or the gauge frame, particularly for larger values.
This reduces readability and affects the overall visual presentation of the gauge.
The same code pattern exists in the Progress Gauge example, meaning the issue could appear there as well.

Steps:
. Analyzed the issue in gauge-speed.ts to identify why the detail text overlaps with the pointer.
. Confirmed that the same code structure exists in progress-gauge.ts, making it susceptible to the same problem.
. Raised an issue #135
to track the problem.

Implemented a step-by-step fix in the TypeScript file:

  1. Adjusted detail.offsetCenter to move the text slightly downward.
  2. Updated rich.value and rich.unit styling to properly center the value and unit.
  3. Verified that the text is clearly visible, centered, and no longer overlaps the pointer.

Before:
Guage

=> Detail text (value + unit) overlaps with the pointer or gauge frame.
=> For larger values, the value text appears too close to the pointer, reducing readability.

After:
After Guage

=> Text is now properly centered and clearly visible.
=> No overlap with the pointer or gauge frame.

Local Testing:
. Tested on local build for the full range of values.
. Confirmed that the fix works consistently across all values in the gauge.

Impact:

. Improves readability and visual clarity in the Progress Gauge example.
. Ensures the official editor is consistent with local builds.
. Prevents confusion caused by overlapping detail text in gauges.

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

You should also run node tool/build-example.js --pattern gauge-speed to generate the thumbnail and commit. Please don't include other thumbnails other than this example.

@@ -1,6 +1,6 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert the unrelated changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

};

export {};
export {}; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New Updated Done

@Manahil-Afzal Manahil-Afzal requested a review from Ovilia January 21, 2026 10:51
@Manahil-Afzal Manahil-Afzal deleted the fix-gauge branch January 21, 2026 11:50
@Manahil-Afzal
Copy link
Contributor Author

Due to commits issues i goona closed this pr and create a new pr

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.

2 participants