2 * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
16 package org.achartengine.renderer;
\r
18 import java.util.HashMap;
\r
19 import java.util.LinkedHashMap;
\r
20 import java.util.Map;
\r
22 import org.achartengine.util.MathHelper;
\r
24 import android.graphics.Color;
\r
25 import android.graphics.Paint.Align;
\r
28 * Multiple XY series renderer.
\r
30 public class XYMultipleSeriesRenderer extends DefaultRenderer {
\r
31 /** The X axis title. */
\r
32 private String mXTitle = "";
\r
33 /** The Y axis title. */
\r
34 private String[] mYTitle;
\r
35 /** The axis title text size. */
\r
36 private float mAxisTitleTextSize = 12;
\r
37 /** The start value in the X axis range. */
\r
38 private double[] mMinX;
\r
39 /** The end value in the X axis range. */
\r
40 private double[] mMaxX;
\r
41 /** The start value in the Y axis range. */
\r
42 private double[] mMinY;
\r
43 /** The end value in the Y axis range. */
\r
44 private double[] mMaxY;
\r
45 /** The approximative number of labels on the x axis. */
\r
46 private int mXLabels = 5;
\r
47 /** The approximative number of labels on the y axis. */
\r
48 private int mYLabels = 5;
\r
49 /** The current orientation of the chart. */
\r
50 private Orientation mOrientation = Orientation.HORIZONTAL;
\r
51 /** The X axis text labels. */
\r
52 private Map<Double, String> mXTextLabels = new HashMap<Double, String>();
\r
53 /** The Y axis text labels. */
\r
54 private Map<Integer, Map<Double, String>> mYTextLabels = new LinkedHashMap<Integer, Map<Double, String>>();
\r
55 /** A flag for enabling or not the pan on the X axis. */
\r
56 private boolean mPanXEnabled = true;
\r
57 /** A flag for enabling or not the pan on the Y axis. */
\r
58 private boolean mPanYEnabled = true;
\r
59 /** A flag for enabling or not the zoom on the X axis. */
\r
60 private boolean mZoomXEnabled = true;
\r
61 /** A flag for enabling or not the zoom on the Y axis . */
\r
62 private boolean mZoomYEnabled = true;
\r
63 /** The spacing between bars, in bar charts. */
\r
64 private double mBarSpacing = 0;
\r
65 /** The margins colors. */
\r
66 private int mMarginsColor = NO_COLOR;
\r
67 /** The pan limits. */
\r
68 private double[] mPanLimits;
\r
69 /** The zoom limits. */
\r
70 private double[] mZoomLimits;
\r
71 /** The X axis labels rotation angle. */
\r
72 private float mXLabelsAngle;
\r
73 /** The Y axis labels rotation angle. */
\r
74 private float mYLabelsAngle;
\r
75 /** The initial axis range. */
\r
76 private Map<Integer, double[]> initialRange = new LinkedHashMap<Integer, double[]>();
\r
77 /** The point size for charts displaying points. */
\r
78 private float mPointSize = 3;
\r
79 /** The grid color. */
\r
80 private int mGridColor = Color.argb(75, 200, 200, 200);
\r
81 /** The number of scales. */
\r
82 private int scalesCount;
\r
83 /** The X axis labels alignment. */
\r
84 private Align xLabelsAlign = Align.CENTER;
\r
85 /** The Y axis labels alignment. */
\r
86 private Align[] yLabelsAlign;
\r
87 /** The Y axis alignment. */
\r
88 private Align[] yAxisAlign;
\r
89 /** The X axis labels color. */
\r
90 private int mXLabelsColor = TEXT_COLOR;
\r
91 /** The Y axis labels color. */
\r
92 private int[] mYLabelsColor = new int[] { TEXT_COLOR };
\r
94 * If X axis value selection algorithm to be used. Only used by the time
\r
97 private boolean mXRoundedLabels = true;
\r
100 * An enum for the XY chart orientation of the X axis.
\r
102 public enum Orientation {
\r
103 HORIZONTAL(0), VERTICAL(90);
\r
104 /** The rotate angle. */
\r
105 private int mAngle = 0;
\r
107 private Orientation(int angle) {
\r
112 * Return the orientation rotate angle.
\r
114 * @return the orientaion rotate angle
\r
116 public int getAngle() {
\r
121 public XYMultipleSeriesRenderer() {
\r
125 public XYMultipleSeriesRenderer(int scaleNumber) {
\r
126 scalesCount = scaleNumber;
\r
127 initAxesRange(scaleNumber);
\r
130 public void initAxesRange(int scales) {
\r
131 mYTitle = new String[scales];
\r
132 yLabelsAlign = new Align[scales];
\r
133 yAxisAlign = new Align[scales];
\r
134 mYLabelsColor = new int[scales];
\r
135 mMinX = new double[scales];
\r
136 mMaxX = new double[scales];
\r
137 mMinY = new double[scales];
\r
138 mMaxY = new double[scales];
\r
139 for (int i = 0; i < scales; i++) {
\r
140 mYLabelsColor[i] = TEXT_COLOR;
\r
141 initAxesRangeForScale(i);
\r
145 public void initAxesRangeForScale(int i) {
\r
146 mMinX[i] = MathHelper.NULL_VALUE;
\r
147 mMaxX[i] = -MathHelper.NULL_VALUE;
\r
148 mMinY[i] = MathHelper.NULL_VALUE;
\r
149 mMaxY[i] = -MathHelper.NULL_VALUE;
\r
150 double[] range = new double[] { mMinX[i], mMaxX[i], mMinY[i], mMaxY[i] };
\r
151 initialRange.put(i, range);
\r
153 mYTextLabels.put(i, new HashMap<Double, String>());
\r
154 yLabelsAlign[i] = Align.CENTER;
\r
155 yAxisAlign[i] = Align.LEFT;
\r
159 * Returns the current orientation of the chart X axis.
\r
161 * @return the chart orientation
\r
163 public Orientation getOrientation() {
\r
164 return mOrientation;
\r
168 * Sets the current orientation of the chart X axis.
\r
170 * @param orientation the chart orientation
\r
172 public void setOrientation(Orientation orientation) {
\r
173 mOrientation = orientation;
\r
177 * Returns the title for the X axis.
\r
179 * @return the X axis title
\r
181 public String getXTitle() {
\r
186 * Sets the title for the X axis.
\r
188 * @param title the X axis title
\r
190 public void setXTitle(String title) {
\r
195 * Returns the title for the Y axis.
\r
197 * @return the Y axis title
\r
199 public String getYTitle() {
\r
200 return getYTitle(0);
\r
204 * Returns the title for the Y axis.
\r
206 * @param scale the renderer scale
\r
207 * @return the Y axis title
\r
209 public String getYTitle(int scale) {
\r
210 return mYTitle[scale];
\r
214 * Sets the title for the Y axis.
\r
216 * @param title the Y axis title
\r
218 public void setYTitle(String title) {
\r
219 setYTitle(title, 0);
\r
223 * Sets the title for the Y axis.
\r
225 * @param title the Y axis title
\r
226 * @param scale the renderer scale
\r
228 public void setYTitle(String title, int scale) {
\r
229 mYTitle[scale] = title;
\r
233 * Returns the axis title text size.
\r
235 * @return the axis title text size
\r
237 public float getAxisTitleTextSize() {
\r
238 return mAxisTitleTextSize;
\r
242 * Sets the axis title text size.
\r
244 * @param textSize the chart axis text size
\r
246 public void setAxisTitleTextSize(float textSize) {
\r
247 mAxisTitleTextSize = textSize;
\r
251 * Returns the start value of the X axis range.
\r
253 * @return the X axis range start value
\r
255 public double getXAxisMin() {
\r
256 return getXAxisMin(0);
\r
260 * Sets the start value of the X axis range.
\r
262 * @param min the X axis range start value
\r
264 public void setXAxisMin(double min) {
\r
265 setXAxisMin(min, 0);
\r
269 * Returns if the minimum X value was set.
\r
271 * @return the minX was set or not
\r
273 public boolean isMinXSet() {
\r
274 return isMinXSet(0);
\r
278 * Returns the end value of the X axis range.
\r
280 * @return the X axis range end value
\r
282 public double getXAxisMax() {
\r
283 return getXAxisMax(0);
\r
287 * Sets the end value of the X axis range.
\r
289 * @param max the X axis range end value
\r
291 public void setXAxisMax(double max) {
\r
292 setXAxisMax(max, 0);
\r
296 * Returns if the maximum X value was set.
\r
298 * @return the maxX was set or not
\r
300 public boolean isMaxXSet() {
\r
301 return isMaxXSet(0);
\r
305 * Returns the start value of the Y axis range.
\r
307 * @return the Y axis range end value
\r
309 public double getYAxisMin() {
\r
310 return getYAxisMin(0);
\r
314 * Sets the start value of the Y axis range.
\r
316 * @param min the Y axis range start value
\r
318 public void setYAxisMin(double min) {
\r
319 setYAxisMin(min, 0);
\r
323 * Returns if the minimum Y value was set.
\r
325 * @return the minY was set or not
\r
327 public boolean isMinYSet() {
\r
328 return isMinYSet(0);
\r
332 * Returns the end value of the Y axis range.
\r
334 * @return the Y axis range end value
\r
336 public double getYAxisMax() {
\r
337 return getYAxisMax(0);
\r
341 * Sets the end value of the Y axis range.
\r
343 * @param max the Y axis range end value
\r
345 public void setYAxisMax(double max) {
\r
346 setYAxisMax(max, 0);
\r
350 * Returns if the maximum Y value was set.
\r
352 * @return the maxY was set or not
\r
354 public boolean isMaxYSet() {
\r
355 return isMaxYSet(0);
\r
359 * Returns the start value of the X axis range.
\r
361 * @param scale the renderer scale
\r
362 * @return the X axis range start value
\r
364 public double getXAxisMin(int scale) {
\r
365 return mMinX[scale];
\r
369 * Sets the start value of the X axis range.
\r
371 * @param min the X axis range start value
\r
372 * @param scale the renderer scale
\r
374 public void setXAxisMin(double min, int scale) {
\r
375 if (!isMinXSet(scale)) {
\r
376 initialRange.get(scale)[0] = min;
\r
378 mMinX[scale] = min;
\r
382 * Returns if the minimum X value was set.
\r
384 * @param scale the renderer scale
\r
385 * @return the minX was set or not
\r
387 public boolean isMinXSet(int scale) {
\r
388 return mMinX[scale] != MathHelper.NULL_VALUE;
\r
392 * Returns the end value of the X axis range.
\r
394 * @param scale the renderer scale
\r
395 * @return the X axis range end value
\r
397 public double getXAxisMax(int scale) {
\r
398 return mMaxX[scale];
\r
402 * Sets the end value of the X axis range.
\r
404 * @param max the X axis range end value
\r
405 * @param scale the renderer scale
\r
407 public void setXAxisMax(double max, int scale) {
\r
408 if (!isMaxXSet(scale)) {
\r
409 initialRange.get(scale)[1] = max;
\r
411 mMaxX[scale] = max;
\r
415 * Returns if the maximum X value was set.
\r
417 * @param scale the renderer scale
\r
418 * @return the maxX was set or not
\r
420 public boolean isMaxXSet(int scale) {
\r
421 return mMaxX[scale] != -MathHelper.NULL_VALUE;
\r
425 * Returns the start value of the Y axis range.
\r
427 * @param scale the renderer scale
\r
428 * @return the Y axis range end value
\r
430 public double getYAxisMin(int scale) {
\r
431 return mMinY[scale];
\r
435 * Sets the start value of the Y axis range.
\r
437 * @param min the Y axis range start value
\r
438 * @param scale the renderer scale
\r
440 public void setYAxisMin(double min, int scale) {
\r
441 if (!isMinYSet(scale)) {
\r
442 initialRange.get(scale)[2] = min;
\r
444 mMinY[scale] = min;
\r
448 * Returns if the minimum Y value was set.
\r
450 * @param scale the renderer scale
\r
451 * @return the minY was set or not
\r
453 public boolean isMinYSet(int scale) {
\r
454 return mMinY[scale] != MathHelper.NULL_VALUE;
\r
458 * Returns the end value of the Y axis range.
\r
460 * @param scale the renderer scale
\r
461 * @return the Y axis range end value
\r
463 public double getYAxisMax(int scale) {
\r
464 return mMaxY[scale];
\r
468 * Sets the end value of the Y axis range.
\r
470 * @param max the Y axis range end value
\r
471 * @param scale the renderer scale
\r
473 public void setYAxisMax(double max, int scale) {
\r
474 if (!isMaxYSet(scale)) {
\r
475 initialRange.get(scale)[3] = max;
\r
477 mMaxY[scale] = max;
\r
481 * Returns if the maximum Y value was set.
\r
483 * @param scale the renderer scale
\r
484 * @return the maxY was set or not
\r
486 public boolean isMaxYSet(int scale) {
\r
487 return mMaxY[scale] != -MathHelper.NULL_VALUE;
\r
491 * Returns the approximate number of labels for the X axis.
\r
493 * @return the approximate number of labels for the X axis
\r
495 public int getXLabels() {
\r
500 * Sets the approximate number of labels for the X axis.
\r
502 * @param xLabels the approximate number of labels for the X axis
\r
504 public void setXLabels(int xLabels) {
\r
505 mXLabels = xLabels;
\r
509 * Adds a new text label for the specified X axis value.
\r
511 * @param x the X axis value
\r
512 * @param text the text label
\r
513 * @deprecated use addXTextLabel instead
\r
515 public void addTextLabel(double x, String text) {
\r
516 addXTextLabel(x, text);
\r
520 * Adds a new text label for the specified X axis value.
\r
522 * @param x the X axis value
\r
523 * @param text the text label
\r
525 public void addXTextLabel(double x, String text) {
\r
526 mXTextLabels.put(x, text);
\r
530 * Returns the X axis text label at the specified X axis value.
\r
532 * @param x the X axis value
\r
533 * @return the X axis text label
\r
535 public String getXTextLabel(Double x) {
\r
536 return mXTextLabels.get(x);
\r
540 * Returns the X text label locations.
\r
542 * @return the X text label locations
\r
544 public Double[] getXTextLabelLocations() {
\r
545 return mXTextLabels.keySet().toArray(new Double[0]);
\r
549 * Clears the existing text labels.
\r
551 * @deprecated use clearXTextLabels instead
\r
553 public void clearTextLabels() {
\r
554 clearXTextLabels();
\r
558 * Clears the existing text labels on the X axis.
\r
560 public void clearXTextLabels() {
\r
561 mXTextLabels.clear();
\r
565 * If X axis labels should be rounded.
\r
567 * @return if rounded time values to be used
\r
569 public boolean isXRoundedLabels() {
\r
570 return mXRoundedLabels;
\r
574 * Sets if X axis rounded time values to be used.
\r
576 * @param rounded rounded values to be used
\r
578 public void setXRoundedLabels(boolean rounded) {
\r
579 mXRoundedLabels = rounded;
\r
583 * Adds a new text label for the specified Y axis value.
\r
585 * @param y the Y axis value
\r
586 * @param text the text label
\r
588 public void addYTextLabel(double y, String text) {
\r
589 addYTextLabel(y, text, 0);
\r
593 * Adds a new text label for the specified Y axis value.
\r
595 * @param y the Y axis value
\r
596 * @param text the text label
\r
597 * @param scale the renderer scale
\r
599 public void addYTextLabel(double y, String text, int scale) {
\r
600 mYTextLabels.get(scale).put(y, text);
\r
604 * Returns the Y axis text label at the specified Y axis value.
\r
606 * @param y the Y axis value
\r
607 * @return the Y axis text label
\r
609 public String getYTextLabel(Double y) {
\r
610 return getYTextLabel(y, 0);
\r
614 * Returns the Y axis text label at the specified Y axis value.
\r
616 * @param y the Y axis value
\r
617 * @param scale the renderer scale
\r
618 * @return the Y axis text label
\r
620 public String getYTextLabel(Double y, int scale) {
\r
621 return mYTextLabels.get(scale).get(y);
\r
625 * Returns the Y text label locations.
\r
627 * @return the Y text label locations
\r
629 public Double[] getYTextLabelLocations() {
\r
630 return getYTextLabelLocations(0);
\r
634 * Returns the Y text label locations.
\r
636 * @param scale the renderer scale
\r
637 * @return the Y text label locations
\r
639 public Double[] getYTextLabelLocations(int scale) {
\r
640 return mYTextLabels.get(scale).keySet().toArray(new Double[0]);
\r
644 * Clears the existing text labels on the Y axis.
\r
646 public void clearYTextLabels() {
\r
647 clearYTextLabels(0);
\r
651 * Clears the existing text labels on the Y axis.
\r
653 * @param scale the renderer scale
\r
655 public void clearYTextLabels(int scale) {
\r
656 mYTextLabels.get(scale).clear();
\r
660 * Returns the approximate number of labels for the Y axis.
\r
662 * @return the approximate number of labels for the Y axis
\r
664 public int getYLabels() {
\r
669 * Sets the approximate number of labels for the Y axis.
\r
671 * @param yLabels the approximate number of labels for the Y axis
\r
673 public void setYLabels(int yLabels) {
\r
674 mYLabels = yLabels;
\r
678 * Sets if the chart point values should be displayed as text.
\r
680 * @param display if the chart point values should be displayed as text
\r
681 * @deprecated use SimpleSeriesRenderer.setDisplayChartValues() instead
\r
683 public void setDisplayChartValues(boolean display) {
\r
684 SimpleSeriesRenderer[] renderers = getSeriesRenderers();
\r
685 for (SimpleSeriesRenderer renderer : renderers) {
\r
686 renderer.setDisplayChartValues(display);
\r
691 * Sets the chart values text size.
\r
693 * @param textSize the chart values text size
\r
694 * @deprecated use SimpleSeriesRenderer.setChartValuesTextSize() instead
\r
696 public void setChartValuesTextSize(float textSize) {
\r
697 SimpleSeriesRenderer[] renderers = getSeriesRenderers();
\r
698 for (SimpleSeriesRenderer renderer : renderers) {
\r
699 renderer.setChartValuesTextSize(textSize);
\r
704 * Returns the enabled state of the pan on at least one axis.
\r
706 * @return if pan is enabled
\r
708 public boolean isPanEnabled() {
\r
709 return isPanXEnabled() || isPanYEnabled();
\r
713 * Returns the enabled state of the pan on X axis.
\r
715 * @return if pan is enabled on X axis
\r
717 public boolean isPanXEnabled() {
\r
718 return mPanXEnabled;
\r
722 * Returns the enabled state of the pan on Y axis.
\r
724 * @return if pan is enabled on Y axis
\r
726 public boolean isPanYEnabled() {
\r
727 return mPanYEnabled;
\r
731 * Sets the enabled state of the pan.
\r
733 * @param enabledX pan enabled on X axis
\r
734 * @param enabledY pan enabled on Y axis
\r
736 public void setPanEnabled(boolean enabledX, boolean enabledY) {
\r
737 mPanXEnabled = enabledX;
\r
738 mPanYEnabled = enabledY;
\r
742 * Returns the enabled state of the zoom on at least one axis.
\r
744 * @return if zoom is enabled
\r
746 public boolean isZoomEnabled() {
\r
747 return isZoomXEnabled() || isZoomYEnabled();
\r
751 * Returns the enabled state of the zoom on X axis.
\r
753 * @return if zoom is enabled on X axis
\r
755 public boolean isZoomXEnabled() {
\r
756 return mZoomXEnabled;
\r
760 * Returns the enabled state of the zoom on Y axis.
\r
762 * @return if zoom is enabled on Y axis
\r
764 public boolean isZoomYEnabled() {
\r
765 return mZoomYEnabled;
\r
769 * Sets the enabled state of the zoom.
\r
771 * @param enabledX zoom enabled on X axis
\r
772 * @param enabledY zoom enabled on Y axis
\r
774 public void setZoomEnabled(boolean enabledX, boolean enabledY) {
\r
775 mZoomXEnabled = enabledX;
\r
776 mZoomYEnabled = enabledY;
\r
780 * Returns the spacing between bars, in bar charts.
\r
782 * @return the spacing between bars
\r
783 * @deprecated use getBarSpacing instead
\r
785 public double getBarsSpacing() {
\r
786 return getBarSpacing();
\r
790 * Returns the spacing between bars, in bar charts.
\r
792 * @return the spacing between bars
\r
794 public double getBarSpacing() {
\r
795 return mBarSpacing;
\r
799 * Sets the spacing between bars, in bar charts. Only available for bar
\r
800 * charts. This is a coefficient of the bar width. For instance, if you want
\r
801 * the spacing to be a half of the bar width, set this value to 0.5.
\r
803 * @param spacing the spacing between bars coefficient
\r
805 public void setBarSpacing(double spacing) {
\r
806 mBarSpacing = spacing;
\r
810 * Returns the margins color.
\r
812 * @return the margins color
\r
814 public int getMarginsColor() {
\r
815 return mMarginsColor;
\r
819 * Sets the color of the margins.
\r
821 * @param color the margins color
\r
823 public void setMarginsColor(int color) {
\r
824 mMarginsColor = color;
\r
828 * Returns the grid color.
\r
830 * @return the grid color
\r
832 public int getGridColor() {
\r
837 * Sets the color of the grid.
\r
839 * @param color the grid color
\r
841 public void setGridColor(int color) {
\r
842 mGridColor = color;
\r
846 * Returns the pan limits.
\r
848 * @return the pan limits
\r
850 public double[] getPanLimits() {
\r
855 * Sets the pan limits as an array of 4 values. Setting it to null or a
\r
856 * different size array will disable the panning limitation. Values:
\r
857 * [panMinimumX, panMaximumX, panMinimumY, panMaximumY]
\r
859 * @param panLimits the pan limits
\r
861 public void setPanLimits(double[] panLimits) {
\r
862 mPanLimits = panLimits;
\r
866 * Returns the zoom limits.
\r
868 * @return the zoom limits
\r
870 public double[] getZoomLimits() {
\r
871 return mZoomLimits;
\r
875 * Sets the zoom limits as an array of 4 values. Setting it to null or a
\r
876 * different size array will disable the zooming limitation. Values:
\r
877 * [zoomMinimumX, zoomMaximumX, zoomMinimumY, zoomMaximumY]
\r
879 * @param zoomLimits the zoom limits
\r
881 public void setZoomLimits(double[] zoomLimits) {
\r
882 mZoomLimits = zoomLimits;
\r
886 * Returns the rotation angle of labels for the X axis.
\r
888 * @return the rotation angle of labels for the X axis
\r
890 public float getXLabelsAngle() {
\r
891 return mXLabelsAngle;
\r
895 * Sets the rotation angle (in degrees) of labels for the X axis.
\r
897 * @param angle the rotation angle of labels for the X axis
\r
899 public void setXLabelsAngle(float angle) {
\r
900 mXLabelsAngle = angle;
\r
904 * Returns the rotation angle of labels for the Y axis.
\r
906 * @return the approximate number of labels for the Y axis
\r
908 public float getYLabelsAngle() {
\r
909 return mYLabelsAngle;
\r
913 * Sets the rotation angle (in degrees) of labels for the Y axis.
\r
915 * @param angle the rotation angle of labels for the Y axis
\r
917 public void setYLabelsAngle(float angle) {
\r
918 mYLabelsAngle = angle;
\r
922 * Returns the size of the points, for charts displaying points.
\r
924 * @return the point size
\r
926 public float getPointSize() {
\r
931 * Sets the size of the points, for charts displaying points.
\r
933 * @param size the point size
\r
935 public void setPointSize(float size) {
\r
939 public void setRange(double[] range) {
\r
940 setRange(range, 0);
\r
944 * Sets the axes range values.
\r
946 * @param range an array having the values in this order: minX, maxX, minY,
\r
948 * @param scale the renderer scale
\r
950 public void setRange(double[] range, int scale) {
\r
951 setXAxisMin(range[0], scale);
\r
952 setXAxisMax(range[1], scale);
\r
953 setYAxisMin(range[2], scale);
\r
954 setYAxisMax(range[3], scale);
\r
957 public boolean isInitialRangeSet() {
\r
958 return isInitialRangeSet(0);
\r
962 * Returns if the initial range is set.
\r
964 * @param scale the renderer scale
\r
965 * @return the initial range was set or not
\r
967 public boolean isInitialRangeSet(int scale) {
\r
968 return initialRange.get(scale) != null;
\r
972 * Returns the initial range.
\r
974 * @return the initial range
\r
976 public double[] getInitialRange() {
\r
977 return getInitialRange(0);
\r
981 * Returns the initial range.
\r
983 * @param scale the renderer scale
\r
984 * @return the initial range
\r
986 public double[] getInitialRange(int scale) {
\r
987 return initialRange.get(scale);
\r
991 * Sets the axes initial range values. This will be used in the zoom fit tool.
\r
993 * @param range an array having the values in this order: minX, maxX, minY,
\r
996 public void setInitialRange(double[] range) {
\r
997 setInitialRange(range, 0);
\r
1001 * Sets the axes initial range values. This will be used in the zoom fit tool.
\r
1003 * @param range an array having the values in this order: minX, maxX, minY,
\r
1005 * @param scale the renderer scale
\r
1007 public void setInitialRange(double[] range, int scale) {
\r
1008 initialRange.put(scale, range);
\r
1012 * Returns the X axis labels color.
\r
1014 * @return the X axis labels color
\r
1016 public int getXLabelsColor() {
\r
1017 return mXLabelsColor;
\r
1021 * Returns the Y axis labels color.
\r
1023 * @return the Y axis labels color
\r
1025 public int getYLabelsColor(int scale) {
\r
1026 return mYLabelsColor[scale];
\r
1030 * Sets the X axis labels color.
\r
1032 * @param color the X axis labels color
\r
1034 public void setXLabelsColor(int color) {
\r
1035 mXLabelsColor = color;
\r
1039 * Sets the Y axis labels color.
\r
1041 * @param scale the renderer scale
\r
1042 * @param color the Y axis labels color
\r
1044 public void setYLabelsColor(int scale, int color) {
\r
1045 mYLabelsColor[scale] = color;
\r
1049 * Returns the X axis labels alignment.
\r
1051 * @return X labels alignment
\r
1053 public Align getXLabelsAlign() {
\r
1054 return xLabelsAlign;
\r
1058 * Sets the X axis labels alignment.
\r
1060 * @param align the X labels alignment
\r
1062 public void setXLabelsAlign(Align align) {
\r
1063 xLabelsAlign = align;
\r
1067 * Returns the Y axis labels alignment.
\r
1069 * @param scale the renderer scale
\r
1070 * @return Y labels alignment
\r
1072 public Align getYLabelsAlign(int scale) {
\r
1073 return yLabelsAlign[scale];
\r
1076 public void setYLabelsAlign(Align align) {
\r
1077 setYLabelsAlign(align, 0);
\r
1080 public Align getYAxisAlign(int scale) {
\r
1081 return yAxisAlign[scale];
\r
1084 public void setYAxisAlign(Align align, int scale) {
\r
1085 yAxisAlign[scale] = align;
\r
1089 * Sets the Y axis labels alignment.
\r
1091 * @param align the Y labels alignment
\r
1093 public void setYLabelsAlign(Align align, int scale) {
\r
1094 yLabelsAlign[scale] = align;
\r
1097 public int getScalesCount() {
\r
1098 return scalesCount;
\r