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
Description:
I'm requesting that Chart.js expose its cubic interpolation algorithm (specifically the 'monotone' mode) as a utility function that developers can use outside of the main chart drawing functionality.
Use Case:
I'm currently developing an application where I need to:
Display a main curve using Chart.js's excellent cubic interpolation
Show a moving point (date of interest indicator) that should follow the exact same curve
Currently, I can only approximate this with linear interpolation between points
Having access to the same interpolation algorithm would ensure consistent visualization
Current Workarounds:
Currently, developers needing this functionality must either:
Implement their own cubic interpolation (potentially inconsistent with Chart.js)
Use linear interpolation (less visually appealing)
Create complex workarounds to try to access the internal calculations
Proposed Solution:
Add a utility function to Chart.js that:
Takes an array of points (x,y coordinates)
Takes a specific x value to interpolate
Returns the interpolated y value using the same algorithm as cubicInterpolationMode: 'monotone'
Example API could look like:
constinterpolatedY=Chart.helpers.interpolateCubicMonotone(points,xValue);
### PossibleImplementationProposedSolution:
AddautilityfunctiontoChart.js that:
-Takesanarrayofpoints(x,ycoordinates)-Takesaspecificxvaluetointerpolate-ReturnstheinterpolatedyvalueusingthesamealgorithmascubicInterpolationMode: 'monotone'
Example APIcouldlooklike:
```javascriptconstinterpolatedY=Chart.helpers.interpolateCubicMonotone(points,xValue);
The text was updated successfully, but these errors were encountered:
Feature Proposal
Description:
I'm requesting that Chart.js expose its cubic interpolation algorithm (specifically the 'monotone' mode) as a utility function that developers can use outside of the main chart drawing functionality.
Use Case:
I'm currently developing an application where I need to:
Current Workarounds:
Currently, developers needing this functionality must either:
Proposed Solution:
Add a utility function to Chart.js that:
Example API could look like:
The text was updated successfully, but these errors were encountered: