You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My goal is to render points and line segments outside the chart area. This almost works by setting the dataset clip option to false, but not quite. Expected that when clipping is disabled, all points and line segments that can be shown, should in fact be shown.
Current behavior
This function trims data points that are outside the chart area even if they would be visible on the canvas:
In the provided codepen, the first three data points are:
{x: 1.4, y: 0},
{x: 1.45, y: 12},
{x: 1.6, y: 3},
All of these ought to be displayed, but in fact only the last point and the line segment preceding it are.
Possible solutions
_getStartAndCountOfVisiblePoints could be updated to account for clipping behavior and the full visible canvas
an option could be provided to disable the point trimming behavior altogether
Context
In our system we are animating new data entering and exiting the chart as the x-axis timebounds change. The current behavior causes data to suddenly appear rather than smoothly enter from offscreen.
chart.js version
v4.4.0
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered:
indirectlylit
changed the title
_getStartAndCountOfVisiblePoints does not incude all visible points
setting clip: false does not in fact allow all points and line segments to be visible
Sep 16, 2024
indirectlylit
changed the title
setting clip: false does not in fact allow all points and line segments to be visible
setting clip: false does not allow all points and line segments to be visible
Sep 16, 2024
indirectlylit
changed the title
setting clip: false does not allow all points and line segments to be visible
some points and line segments remain clipped when setting clip: falseSep 16, 2024
Expected behavior
My goal is to render points and line segments outside the chart area. This almost works by setting the dataset
clip
option tofalse
, but not quite. Expected that when clipping is disabled, all points and line segments that can be shown, should in fact be shown.Current behavior
This function trims data points that are outside the chart area even if they would be visible on the canvas:
Chart.js/src/controllers/controller.line.js
Lines 46 to 49 in ea88dba
This prevents the
clip: false
option from working as expected.Reproducible sample
https://codepen.io/devon_fg/pen/poXmLQG?editors=0010
Optional extra steps/info to reproduce
In the provided codepen, the first three data points are:
All of these ought to be displayed, but in fact only the last point and the line segment preceding it are.
Possible solutions
_getStartAndCountOfVisiblePoints
could be updated to account for clipping behavior and the full visible canvasContext
In our system we are animating new data entering and exiting the chart as the x-axis timebounds change. The current behavior causes data to suddenly appear rather than smoothly enter from offscreen.
chart.js version
v4.4.0
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: