chartjs-plugin-trendline
chartjs-plugin-trendline copied to clipboard
Feature request : having the slope in percentage
it would be nice to have the slope in percentage and maybe 2 color depending if negative or positive stops.
I guess by changing :
const trendText = displayValue
? `${text} (Slope: ${slope.toFixed(2)})`
: text;
To :
const trendText = displayValue
? `${text} (Slope: ${(percentage ? (slope * 100).toFixed(2) + '%' : slope.toFixed(2))})`
: text;
Or be able to use a function to return the slops.
Thanks
@kent2004 I made some changes and came up with this suggestion. Is this what you expected?
@Makanz Yes in deed it is what I expected, thank you ;-)