@@ -238,27 +238,10 @@ && isOffContentBottom(valuePoints[j + 1]))
238238
239239 mRenderPaint .setColor (dataSet .getColor ());
240240
241- float [] valuePoints = generateTransformedValuesLineScatter (entries );
242-
243- for (int j = 0 ; j < (valuePoints .length - 2 ) * mPhaseX ; j += 2 ) {
244-
245- if (isOffContentRight (valuePoints [j ]))
246- break ;
247-
248- // make sure the lines don't do shitty things outside
249- // bounds
250- if (j != 0 && isOffContentLeft (valuePoints [j - 1 ])
251- && isOffContentTop (valuePoints [j + 1 ])
252- && isOffContentBottom (valuePoints [j + 1 ]))
253- continue ;
254-
255- mDrawCanvas .drawLine (valuePoints [j ], valuePoints [j + 1 ],
256- valuePoints [j + 2 ], valuePoints [j + 3 ], mRenderPaint );
257- }
258-
259- // Path line = generateLinePath(entries);
260- // transformPath(line);
261- // mDrawCanvas.drawPath(line, mRenderPaint);
241+ Path line = generateLinePath (entries );
242+ transformPath (line );
243+
244+ mDrawCanvas .drawPath (line , mRenderPaint );
262245 }
263246
264247 mRenderPaint .setPathEffect (null );
@@ -320,6 +303,27 @@ private Path generateFilledPath(ArrayList<Entry> entries, float fillMin) {
320303
321304 return filled ;
322305 }
306+
307+ /**
308+ * Generates the path that is used for drawing a single line.
309+ *
310+ * @param entries
311+ * @return
312+ */
313+ private Path generateLinePath (ArrayList <Entry > entries ) {
314+
315+ Path line = new Path ();
316+ line .moveTo (entries .get (0 ).getXIndex (), entries .get (0 ).getVal () * mPhaseY );
317+
318+ // create a new path
319+ for (int x = 1 ; x < entries .size () * mPhaseX ; x ++) {
320+
321+ Entry e = entries .get (x );
322+ line .lineTo (e .getXIndex (), e .getVal () * mPhaseY );
323+ }
324+
325+ return line ;
326+ }
323327
324328 @ Override
325329 protected void drawValues () {
0 commit comments