/
NikolayIvkin
/
MPAndroidChart1
Обзор
Документация
Войти
/
NikolayIvkin
/
MPAndroidChart1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineScatterCandleRadarRenderer.java
63 строки
2 KB
Philipp Jahoda
Further abstraction of XBounds calculation
09 июн 2016, 11:52
09 июн 2016, 11:52
c0bee1c
Код
Авторство
О чём код?
package com.github.mikephil.charting.renderer; import android.graphics.Canvas; import android.graphics.Path; import com.github.mikephil.charting.animation.ChartAnimator; import com.github.mikephil.charting.interfaces.datasets.ILineScatterCandleRadarDataSet; import com.github.mikephil.charting.utils.ViewPortHandler; /** * Created by Philipp Jahoda on 11/07/15. */ public abstract class LineScatterCandleRadarRenderer extends BarLineScatterCandleBubbleRenderer { /** * path that is used for drawing highlight-lines (drawLines(...) cannot be used because of dashes) */ private Path mHighlightLinePath = new Path(); public LineScatterCandleRadarRenderer(ChartAnimator animator, ViewPortHandler viewPortHandler) { super(animator, viewPortHandler); } /** * Draws vertical & horizontal highlight-lines if enabled. * * @param c * @param x x-position of the highlight line intersection * @param y y-position of the highlight line intersection * @param set the currently drawn dataset */ protected void drawHighlightLines(Canvas c, float x, float y, ILineScatterCandleRadarDataSet set) { // set color and stroke-width mHighlightPaint.setColor(set.getHighLightColor()); mHighlightPaint.setStrokeWidth(set.getHighlightLineWidth()); // draw highlighted lines (if enabled) mHighlightPaint.setPathEffect(set.getDashPathEffectHighlight()); // draw vertical highlight lines if (set.isVerticalHighlightIndicatorEnabled()) { // create vertical path mHighlightLinePath.reset(); mHighlightLinePath.moveTo(x, mViewPortHandler.contentTop()); mHighlightLinePath.lineTo(x, mViewPortHandler.contentBottom()); c.drawPath(mHighlightLinePath, mHighlightPaint); } // draw horizontal highlight lines if (set.isHorizontalHighlightIndicatorEnabled()) { // create horizontal path mHighlightLinePath.reset(); mHighlightLinePath.moveTo(mViewPortHandler.contentLeft(), y); mHighlightLinePath.lineTo(mViewPortHandler.contentRight(), y); c.drawPath(mHighlightLinePath, mHighlightPaint); } } }