I need to create a dynamic scales something like this
Range 1 = 0 to 100
Range 2 = 100 to 200
Range 3 = 200 to 300
Range 4 = 300 to 400
Range 5 = 400 to 500
Range 6 = 600 to 700
Range 7 = 700 to 800
Range 8 = 800 to 900
Range 9 = 900 to 1000
Here, ranges are 1 to 9 and minimum value is 0 and maximum value is 1000. These ranges, minimum and maximum values are dynamic.
So, I required a function to return the scales.
For example:-
function getScales(minRage, maxRange, minValue, maxValue){
var scales={};
..........
............
return scales;
}
//Output:
[
{
range :1
min :0,
max :100
},
{
range :2
min :100,
max :200
},
{
range :3
min :200,
max :300
},
....
....
{
range :9,
min :900,
max :1000
}
]
To get above result , I need to call the function like this getScales(1, 9, 0, 1000).

This is what my actual requirement: if I call getScales(1, 5, 4000, 418500);