@@ -32,133 +32,7 @@ public StepRenderer(XYPlot plot) {
3232
3333 @ Override
3434 protected void appendToPath (Path path , PointF thisPoint , PointF lastPoint ) {
35- //path.lineTo(thisPoint.x, thisPoint.y);
36-
3735 path .lineTo (thisPoint .x , lastPoint .y );
3836 path .lineTo (thisPoint .x , thisPoint .y );
39- //canvas.drawPoint(point.x, lastPoint.y, format.getVertexPaint());
40- // next the vertical:
41- //canvas.drawLine(point.x, lastPoint.y, point.x, point.y, format.getLinePaint());
42- }
43- }
44- /*
45- public class StepRenderer extends XYSeriesRenderer<StepFormatter> {
46-
47- private PointF lastPoint;
48-
49- private boolean drawLinesEnabled = true;
50- private boolean drawPointsEnabled = true;
51-
52- private XYAxisType stepAxis = XYAxisType.DOMAIN;
53-
54-
55-
56- public StepRenderer(XYPlot plot) {
57- super(plot);
58- }
59-
60- @Override
61- public void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException {
62-
63-
64-
65- for(XYSeries series : getPlot().getSeriesListForRenderer(this.getClass())) {
66-
67- drawSeries(canvas, plotArea, series, getFormatter(series));
68- }
69- //foreach(this.)
70- //foreach()
71- }
72-
73- @Override
74- public void doDrawLegendIcon(Canvas canvas, RectF rect, String text, StepFormatter getFormatter) {
75- // horizontal icon:
76- float centerY = rect.centerY();
77- float centerX = rect.centerX();
78- canvas.drawLine(rect.left, rect.top, rect.right, rect.bottom, getFormatter.getLinePaint());
79- canvas.drawPoint(centerX, centerY, getFormatter.getVertexPaint());
80- //canvas.drawRect(rect, getFormatter.getLinePaint());
81-
82- }
83-
84-
85- private void drawSeries(Canvas canvas, RectF plotArea, XYSeries series, StepFormatter getFormatter) throws PlotRenderException {
86- beginSeries(canvas, plotArea, getFormatter);
87- //XYDataset series = bundle.getDataset();
88- //int seriesIndex = bundle.getSeriesIndex();
89- PointF thisPoint;
90- for (int i = 0; i < series.size(); i++) {
91- Number y = series.getY(i);
92- Number x = series.getD(i);
93-
94- if (y != null && x != null) {
95-
96- thisPoint = ValPixConverter.valToPix(
97- x,
98- y,
99- plotArea,
100- getPlot().getCalculatedMinX(),
101- getPlot().getCalculatedMaxX(),
102- getPlot().getCalculatedMinY(),
103- getPlot().getCalculatedMaxY());
104- //float pixX = ValPixConverter.valToPix(x.doubleValue(), getPlot().getCalculatedMinX().doubleValue(), getPlot().getCalculatedMaxX().doubleValue(), plotArea.width(), false) + (plotArea.left);
105- //float pixY = ValPixConverter.valToPix(y.doubleValue(), getPlot().getCalculatedMinY().doubleValue(), getPlot().getCalculatedMaxY().doubleValue(), plotArea.height(), true) + plotArea.top;
106-
107- //thisPoint = new PointF(pixX, pixY);
108- } else {
109- thisPoint = null;
110- }
111- drawPoint(canvas, thisPoint, plotArea, getFormatter);
112- }
113- endSeries(canvas, plotArea, getFormatter);
114- }
115-
116- private void beginSeries(Canvas canvas, RectF plotArea, StepFormatter format) throws PlotRenderException {
117- lastPoint = null;
118- }
119-
120- private void drawPoint(Canvas canvas, PointF point, RectF plotArea, StepFormatter format) throws PlotRenderException {
121- if (lastPoint != null) {
122- if (point != null) {
123-
124- switch(stepAxis) {
125- case DOMAIN:
126- // first draw the horizontal line:
127- canvas.drawLine(lastPoint.x, lastPoint.y, point.x, lastPoint.y, format.getLinePaint());
128- canvas.drawPoint(point.x, lastPoint.y, format.getVertexPaint());
129- // next the vertical:
130- canvas.drawLine(point.x, lastPoint.y, point.x, point.y, format.getLinePaint());
131- break;
132- case RANGE:
133- break;
134- }
135- //doDrawLine(canvas, lastPoint, point, plotArea, format);
136-
137-
138- }
139- drawLastPoint(canvas, plotArea, format);
140- }
141-
142- lastPoint = point;
143- }
144-
145- private void endSeries(Canvas canvas, RectF plotArea, StepFormatter format) throws PlotRenderException {
146- if(lastPoint != null) {
147- drawLastPoint(canvas, plotArea, format);
148- }
149- }
150-
151- protected void drawLastPoint(Canvas canvas, RectF plotArea, StepFormatter format) throws PlotRenderException {
152- canvas.drawPoint(lastPoint.x, lastPoint.y, format.getVertexPaint());
153- }
154-
155-
156- public XYAxisType getStepAxis() {
157- return stepAxis;
158- }
159-
160- public void setStepAxis(XYAxisType stepAxis) {
161- this.stepAxis = stepAxis;
16237 }
16338}
164- */
0 commit comments