How do I get the highest and lowest yaxis value?

1,783 views
Skip to first unread message

RyanP

unread,
Sep 8, 2011, 9:44:17 PM9/8/11
to jqplot-users
Hi all,

I am new to jQplot and I got a problem. Is there a way to get the
highest and lowest yaxis value? I need to call it on my JS function.

Base on this chart:

http://technogadge.com/wp-content/uploads/2010/03/jqplot-jquery-plugin1.jpg

Highest = $757.06
Lowest = $250.77

I am not sure if it is really yaxis value is the right term to use.
I've been stuck to his for a couple of days now. Any help would be
greatly appreciated.

Chris Leonello

unread,
Sep 8, 2011, 9:47:32 PM9/8/11
to jqplot...@googlegroups.com
var plot = $.jqplot('container', [data], {options});

var ymin = plot.axes.yaxis.min;
var ymax = plot.axes.yaxis.max;

-- 
Chris Leonello
http://www.jqplot.com
--
You received this message because you are subscribed to the Google Groups "jqplot-users" group.
To post to this group, send email to jqplot...@googlegroups.com.
To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jqplot-users?hl=en.

RyanP

unread,
Sep 8, 2011, 10:01:36 PM9/8/11
to jqplot-users
Hi Chris,

Thanks for the reply. But I guess I am misunderstood here. As we can
see in the graph.

'ymax' would give less than $757.06 and 'ymin' would give higher than
$250.77.

I am referring to the 'labels' maybe for y if that would you called
it.


Thank you.

On Sep 9, 9:47 am, Chris Leonello <jqplot-us...@jqplot.com> wrote:
> var plot = $.jqplot('container', [data], {options});
>
> var ymin = plot.axes.yaxis.min;
> var ymax = plot.axes.yaxis.max;
>
> --
> Chris Leonellohttp://www.jqplot.com
>
>
>
>
>
>
>
> On Thursday, September 8, 2011 at 9:44 PM, RyanP wrote:
> > Hi all,
>
> > I am new to jQplot and I got a problem. Is there a way to get the
> > highest and lowest yaxis value? I need to call it on my JS function.
>
> > Base on this chart:
>
> >http://technogadge.com/wp-content/uploads/2010/03/jqplot-jquery-plugi...
>
> > Highest = $757.06
> > Lowest = $250.77
>
> > I am not sure if it is really yaxis value is the right term to use.
> > I've been stuck to his for a couple of days now. Any help would be
> > greatly appreciated.
>
> > --
> > You received this message because you are subscribed to the Google Groups "jqplot-users" group.
> > To post to this group, send email to jqplot...@googlegroups.com (mailto:jqplot...@googlegroups.com).
> > To unsubscribe from this group, send email to jqplot-users...@googlegroups.com (mailto:jqplot-users...@googlegroups.com).

Chris Leonello

unread,
Sep 8, 2011, 10:08:07 PM9/8/11
to jqplot...@googlegroups.com
If you mean the minimum and maximum values of the data:

var ymin = plot.axes.yaxis._dataBounds.min;
var ymax = plot.axes.yaxis._dataBounds.max;

If you mean the actual labels on the ticks:

var nticks = plot.axes.yaxis._ticks.length;
var ymin = plot.axes.yaxis._ticks[0].label;
var ymax = plot.axes.yaxis._ticks[nticks-1].label;

-- 
Chris Leonello
http://www.jqplot.com
To post to this group, send email to jqplot...@googlegroups.com.
To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.

RyanP

unread,
Sep 8, 2011, 10:16:01 PM9/8/11
to jqplot-users
Hi Chris,

Thank you so much. It's a great help.

Ryan

On Sep 9, 10:08 am, Chris Leonello <jqplot-us...@jqplot.com> wrote:
> If you mean the minimum and maximum values of the data:
>
> var ymin = plot.axes.yaxis._dataBounds.min;var ymax = plot.axes.yaxis._dataBounds.max;
>
> If you mean the actual labels on the ticks:
>
> var nticks = plot.axes.yaxis._ticks.length;
> var ymin = plot.axes.yaxis._ticks[0].label;
> var ymax = plot.axes.yaxis._ticks[nticks-1].label;
>
> --
> Chris Leonellohttp://www.jqplot.com
>
>
>
>
>
>
>
> On Thursday, September 8, 2011 at 10:01 PM, RyanP wrote:
> > Hi Chris,
>
> > Thanks for the reply. But I guess I am misunderstood here. As we can
> > see in the graph.
>
> > 'ymax' would give less than $757.06 and 'ymin' would give higher than
> > $250.77.
>
> > I am referring to the 'labels' maybe for y if that would you called
> > it.
>
> > Thank you.
>

Chris Leonello

unread,
Sep 8, 2011, 10:19:03 PM9/8/11
to jqplot...@googlegroups.com
You're welcome :-)

-- 
Chris Leonello
http://www.jqplot.com
To post to this group, send email to jqplot...@googlegroups.com.
To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.

Tsai MW

unread,
May 29, 2014, 11:53:35 PM5/29/14
to jqplot...@googlegroups.com, remote...@gmail.com
Hi Chris,

One question related to this topic.
How can I get the highest and lowest yaxis/xaxis value after zoom-in applied?
Thanks in advance.



RyanP於 2011年9月9日星期五UTC+8上午9時44分17秒寫道:
Reply all
Reply to author
Forward
0 new messages