| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="8194Formattingthescalelabels.html">
|
|
|
8 |
<LINK REL="Next" HREF="820Adjustingtheautoscalinglimitsgracevalue.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="8194Formattingthescalelabels.html">Previous</A>
|
|
|
26 |
<A HREF="820Adjustingtheautoscalinglimitsgracevalue.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="8_19_5">8.19.5 Inverting the Y-axis</A></H3>
|
|
|
29 |
<P> One good way of illustrate the usefulness of label callbacks in a
|
|
|
30 |
slightly different context is to show how we can achieve the effect of
|
|
|
31 |
an inverted Y-scale.</P>
|
|
|
32 |
<P> An inverted Y-scale has the lowest number at the top and the scale
|
|
|
33 |
values increases downwards.</P>
|
|
|
34 |
<P> Even though JpGraph doesn't directly support this feature it is
|
|
|
35 |
quite easy to achieve with just a few extra lines of code in your image
|
|
|
36 |
script.</P>
|
|
|
37 |
<P> Before we continue we give an example of what we are referring to.</P>
|
|
|
38 |
<P><DIV class="example">
|
|
|
39 |
<BR> <A href="exframes/frame_inyaxisex2.html" target="blank"><IMG border="0"
|
|
|
40 |
HEIGHT="300" src="img/inyaxisex2.png" WIDTH="400"></A>
|
|
|
41 |
<BR><B>Figure 95:</B> Inverted Y-axis <A href="exframes/frame_inyaxisex2.html"
|
|
|
42 |
target="blank">[src]</A>
|
|
|
43 |
<P></P>
|
|
|
44 |
</DIV></P>
|
|
|
45 |
<P></P>
|
|
|
46 |
<P> Two achieve this effect there are two simple steps to take:</P>
|
|
|
47 |
<OL>
|
|
|
48 |
<LI> Negate all you Y-value in the data</LI>
|
|
|
49 |
<LI> Create a callback that negates the scale labels so they appear to
|
|
|
50 |
be positive.</LI>
|
|
|
51 |
</OL>
|
|
|
52 |
<P> And that's it! We refer you to the code in the example above for the
|
|
|
53 |
details.</P>
|
|
|
54 |
<HR NOSHADE>
|
|
|
55 |
<A HREF="toc.html">Contents</A>
|
|
|
56 |
<A HREF="8194Formattingthescalelabels.html">Previous</A>
|
|
|
57 |
<A HREF="820Adjustingtheautoscalinglimitsgracevalue.html">Next</A>
|
|
|
58 |
</BODY>
|
|
|
59 |
</HTML>
|