chartjs / chartjs-chart-financial

Chart.js module for charting financial securities
MIT License
725 stars 197 forks source link

improve vertical "whitespace" calculation #18

Closed aranlunzer closed 6 years ago

aranlunzer commented 6 years ago

Description

The whitespace calculation at

https://github.com/chartjs/chartjs-chart-financial/blob/c3f235676fb6876a52a603a1ccc4e49fe10edee8/src/scale.financialLinear.js#L80

...is unhelpful for charts that have small movements around a high value. For example, if Bitcoin has recently moved within the range 10700 to 10710, the proposed scale will be from 10165 to 11245. This pull request replaces the whitespace size with 5% of the range, rather than of the absolute value.