Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use UISider to generate a logarithmic scale of values

Is there a way to got the values outputted by a UISlider in an iPhone app to increase exponentially? For example the first third generate 1 -10, the second third generate 11 to 100, and the final third generate 101 to 1000?

like image 339
lavelle Avatar asked Nov 05 '10 11:11

lavelle


People also ask

How do you make a logarithmic scale?

In your XY (scatter) graph, double-click the scale of each axis. In the Format Axis box, select the Scale tab, and then check Logarithmic scale.

Why would you use a logarithmic scale?

The reason to use logarithmic scales is to resolve an issue with visualizations that skew towards large values in a dataset.


1 Answers

You can compute yourself the log/exp value from the slider, and display this value !

But if you want a value between 1 to 1000, you can set min of the slider to 0, max to 3 and make the power of 10:

powf(10.0,mySlider.value)
like image 81
Benoît Avatar answered Oct 19 '22 23:10

Benoît