Are you looking for a solution to generate random numbers for charts that trend upwards and to the right? I am currently utilizing a JavaScript charting engine, so I will require numbers in JSON format eventually. However, I am open to alternative methods if they are easier outside of JavaScript.
If you need a simple randomNumber generator in JavaScript, you can use the following function:
function randomNumber(minimum, maximum){
return Math.round( Math.random() * (maximum - minimum) + minimum);
}
console.log(randomNumber(0,100));
The code above will work as long as the min
and max
values increase over time. Can you provide me with guidance on this matter?
Feel free to experiment with different solutions, including a helpful chart, on this JSFiddle link: http://jsfiddle.net/9ox4wjrf/
Below is a rough example of the type of charts I am aiming to create using the generated data: