@Override public void drawHighlighted(Canvas c, Highlight[] indices) { CandleData candleData = mChart.getCandleData(); for (Highlight high : indices) { ICandleDataSet set = candleData.getDataSetByIndex(high.getDataSetIndex()); if (set == null || !set.isHighlightEnabled()) continue; CandleEntry e = set.getEntryForXValue(high.getX(), high.getY()); if (!isInBoundsX(e, set)) continue; float lowValue = e.getLow() * mAnimator.getPhaseY(); float highValue = e.getHigh() * mAnimator.getPhaseY(); float y = (lowValue + highValue) / 2f; MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelForValues(e.getX(), y); high.setDraw((float) pix.x, (float) pix.y); // draw the lines drawHighlightLines(c, (float) pix.x, (float) pix.y, set); } } }
@Override public void drawHighlighted(Canvas c, Highlight[] indices) { CandleData candleData = mChart.getCandleData(); for (Highlight high : indices) { ICandleDataSet set = candleData.getDataSetByIndex(high.getDataSetIndex()); if (set == null || !set.isHighlightEnabled()) continue; CandleEntry e = set.getEntryForXValue(high.getX(), high.getY()); if (!isInBoundsX(e, set)) continue; float lowValue = e.getLow() * mAnimator.getPhaseY(); float highValue = e.getHigh() * mAnimator.getPhaseY(); float y = (lowValue + highValue) / 2f; MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelForValues(e.getX(), y); high.setDraw((float) pix.x, (float) pix.y); // draw the lines drawHighlightLines(c, (float) pix.x, (float) pix.y, set); } } }
@Override public void drawHighlighted(Canvas c, Highlight[] indices) { CandleData candleData = mChart.getCandleData(); for (Highlight high : indices) { ICandleDataSet set = candleData.getDataSetByIndex(high.getDataSetIndex()); if (set == null || !set.isHighlightEnabled()) continue; CandleEntry e = set.getEntryForXValue(high.getX(), high.getY()); if (!isInBoundsX(e, set)) continue; float lowValue = e.getLow() * mAnimator.getPhaseY(); float highValue = e.getHigh() * mAnimator.getPhaseY(); float y = (lowValue + highValue) / 2f; MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelForValues(e.getX(), y); high.setDraw((float) pix.x, (float) pix.y); // draw the lines drawHighlightLines(c, (float) pix.x, (float) pix.y, set); } } }
@Override public void drawHighlighted(Canvas c, Highlight[] indices) { CandleData candleData = mChart.getCandleData(); for (Highlight high : indices) { ICandleDataSet set = candleData.getDataSetByIndex(high.getDataSetIndex()); if (set == null || !set.isHighlightEnabled()) continue; CandleEntry e = set.getEntryForXValue(high.getX(), high.getY()); if (!isInBoundsX(e, set)) continue; float lowValue = e.getLow() * mAnimator.getPhaseY(); float highValue = e.getHigh() * mAnimator.getPhaseY(); float y = (lowValue + highValue) / 2f; MPPointD pix = mChart.getTransformer(set.getAxisDependency()).getPixelForValues(e.getX(), y); high.setDraw((float) pix.x, (float) pix.y); // draw the lines drawHighlightLines(c, (float) pix.x, (float) pix.y, set); } } }
ICandleDataSet set = candleData.getDataSetByIndex(high.getDataSetIndex());