1. Finding value on a chart - attn. Derek

Derek,

You gave me the formula to find Y.

TickRatio = ((MaxVal - MinVal) / (MaxY - MinY)) Y= floor(MaxY - (Value - MinVal)/TickRatio)

That works out fine. I use it all the time for my chart I am working on.

Thank you very much.

As I forgot a lot of my high school algebra I can't figure out:

Solve for Value given the the Y.

ie...

function getY(atom Value) TickRatio = ((MaxVal - MinVal) / (MaxY - MinY)) return floor(MaxY - (Value - MinVal)/TickRatio) end function

function getValue(integer Y) TickRatio = ((MaxVal - MinVal) / (MaxY - MinY)) return ?? end function

TIA Don Cole

new topic     » topic index » view message » categorize

2. Re: Finding value on a chart - attn. Derek

doncole2009 said...

Solve for Value given the the Y.

Try this ...

  function getValue(integer Y) 
    TickRatio = ((MaxVal - MinVal) / (MaxY - MinY))  
    return floor(MinVal - TickRatio * (Y - MaxY)) 
  end function 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Finding value on a chart - attn. Derek

Thank you Derek.

What I'm trying to do is draw cross hairs (moving with mouse) across graph or window. Without changing the graph or window.

If I ever finish I will upload a simplified version to the archives.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

4. Re: Finding value on a chart - attn. Derek

doncole2009 said...

What I'm trying to do is draw cross hairs (moving with mouse) across graph or window. Without changing the graph or window.

Don, if you're using Win32Lib, you can probably just change the cursor to cross hairs while it's over the graph. That way, you let the system draw it. You don't have to worry about plotting anything over your graph.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Finding value on a chart - attn. Derek

euphoric said...
doncole2009 said...

What I'm trying to do is draw cross hairs (moving with mouse) across graph or window. Without changing the graph or window.

Don, if you're using Win32Lib, you can probably just change the cursor to cross hairs while it's over the graph. That way, you let the system draw it. You don't have to worry about plotting anything over your graph.

I think he means that the cross hairs extended from the top to bottom and left to right of the graph window but the intersection is where the mouse is.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Finding value on a chart - attn. Derek

That's right on the right side of the graph are the prices

that will change color when the mouse rolls over them.

Perhaps a reverse of then original then it will return to normal

when the mouse leaves.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

7. Re: Finding value on a chart - attn. Derek

although I'm not entirely sure what your project is, i came across a wonderful piece of code years ago that generates it's own self scaling graphs based on any x,y type data sequence. the original thread is posted here.

http://www.rapideuphoria.com/cgi-bin/esearch.exu?fromMonth=6&fromYear=1&toMonth=5&toYear=D&postedBy=&keywords=chart.ew

hope it helps!

OtterDad

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu