[Bug] Line chart tiny segments skipped, becoming a slope
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- data-visualization
Research direction
Start with the tiny-segment handling around line 83 of src/chart/line/poly.ts and reproduce the issue using the linked CodeSandbox with step:'end'. Verify the fix against the reported datapoints and confirm that the segment from datapoint2 to datapoint3 is rendered vertically rather than as a slope.
Written by the indexing model from the issue text.
Description
Version
5.6.0
Link to Minimal Reproduction
https://codesandbox.io/p/sandbox/pdh82y?file=%2Findex.js
Steps to Reproduce
- change the time on datapoint1 from 08:59:30 to 08:55:30
- change the time on datapoint1 back
- repeat
Current Behavior
When we have the following data:
- datapoint1=[08:59:30, 1]
- datapoint2=[09:00:00, 1]
- datapoint3=[09:00:00, 0]
With the following line chart setting:
- type:'line'
- step:'end'
The line chart ignores datapoint2 and draws a line from datapoint1 to datapoint3 which becomes a slope.
Expected Behavior
The line chart should draw the line vertically (not as a slope) from datapoint2 to datapoint3 to represent what the data is actually doing.
Environment
- OS: Windows 11
- Browser: Microsoft Edge Version 148.0.3967.54 (Official build) (64-bit)
- Framework:
Any additional comments?
The line of code that appears to be causing this behaviour is "/src/chart/line/poly.ts" at line 83. (The section for "Ignore Tiny Segment.")
// Ignore tiny segment.
if ((dx * dx + dy * dy) < 0.5) {
idx += dir;
continue;
}
- Dominant language
- TypeScript
- Stars
- 67.7k
- Forks
- 19.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/echarts
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Possibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePossibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrectPossibly taken @waterWang claimed this 98 days ago. Openbug en pending
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lingdojo/kana-dojo#34223 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
bug status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mastra-ai/mastra#30587 · 1 comment ·
Maintainers usually reply within 1 day
-
area:web p2 product:business triage:active type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cuadrao-ai/argus#2228 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
embedpdf/embed-pdf-viewer#1098 ·
Maintainers usually reply within 1 day
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
metabase/metabase#87252 · 1 comment ·
Maintainers usually reply within 1 day