Skip to main content
added 79 characters in body
Source Link
SKADIN
  • 545
  • 1
  • 6
  • 14

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1 

if bigValue=0.0156 & smallValue=0.01 then maxValue=0.02 & minValue=0.01

How to achieve this with better logic using only javascript?

Here bigValue & smallValue can be of any values & both will be positive.

I have this requirement to set the start and end point for y-axis in graph.

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1

How to achieve this with better logic using only javascript?

Here bigValue & smallValue can be of any values & both will be positive.

I have this requirement to set the start and end point for y-axis in graph.

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1 

if bigValue=0.0156 & smallValue=0.01 then maxValue=0.02 & minValue=0.01

How to achieve this with better logic using only javascript?

Here bigValue & smallValue can be of any values & both will be positive.

I have this requirement to set the start and end point for y-axis in graph.

added 153 characters in body
Source Link
SKADIN
  • 545
  • 1
  • 6
  • 14

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1

How to achieve this with better logic using only javascript?

Here bigValue & smallValue can be of any values & both will be positive.

I have this requirement to set the start and end point for y-axis in graph.

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1

How to achieve this with better logic using only javascript?

i'll be getting two values bigValue & smallValue based on this I should set maxValue & minValue, below are the conditions explained

if bigValue=42 & smallValue=23 then maxValue=50 & minValue=20

if bigValue=12 & smallValue=03 then maxValue=20 & minValue=0

if bigValue=0.156 & smallValue=0.1 then maxValue=0.2 & minValue=0.1

How to achieve this with better logic using only javascript?

Here bigValue & smallValue can be of any values & both will be positive.

I have this requirement to set the start and end point for y-axis in graph.

edited title
Link
Jivings
  • 23.2k
  • 7
  • 62
  • 102

[javascript]How How to get Min and max values based on the given values?

added 20 characters in body
Source Link
Turnip
  • 36.5k
  • 15
  • 91
  • 116
Loading
Source Link
SKADIN
  • 545
  • 1
  • 6
  • 14
Loading