javascript - How can I generate random numbers for demo charts that roughly trend up and to the right? -



javascript - How can I generate random numbers for demo charts that roughly trend up and to the right? -

i need generate random numbers several charts go , right.

i'm using javascript charting engine require numbers in json, can handle conversion if have easy way outside of javascript.

here's simple randomnumber generator in javascript:

function randomnumber(minimum, maximum){ homecoming math.round( math.random() * (maximum - minimum) + minimum); } console.log(randomnumber(0,100));

the above work if min , max grew on time. can point me in right direction?

here's jsfiddle seek out various solutions, including handy chart: http://jsfiddle.net/9ox4wjrf/

here's rough illustration of sorts of charts need build generated data:

something may work:

var = 0.05; var b = 10; //play these values liking var y; //loop here 0 whatever y = * x^2 + b * x * math.random(); //or using randommumber function: y = * x^2 + randommumber(- b * x / 2, b * x / 2);

this way noise gets bigger when farther right

javascript json math random

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -