bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

Value Scale - Logarithmic Progression #211

Open NicFragale opened 5 years ago

NicFragale commented 5 years ago

Just curious. Is there a way to create a scale that is not linear? Instead of say "1-100" being represented as 1,2,3,4,5..so on.. in equal units, I am looking to create a logarithmic scale like progression (1,2,4,8,10,20..so on..).

Speedtest.net is an example. image

kplindegaard commented 5 years ago

Not currently. The scaling in the gauge (and donut for that matter) is linear

  1. Include a "hook" in th e options to an external scaling function the user provides.
  2. Do the scaling outside of gauge.js so that the values and min/max you configure the gauge are logarithmic or whatever kind of scale you like. This will require that you can set labels in the form of names refering to the scaled values.