Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ open class ScatterChartRenderer(@JvmField var chart: ScatterDataProvider, animat

var pixelBuffer: FloatArray = FloatArray(2)

protected fun drawDataSet(canvas: Canvas?, dataSet: IScatterDataSet) {
if (dataSet.entryCount < 1) return
protected fun drawDataSet(canvas: Canvas, dataSet: IScatterDataSet) {
if (dataSet.entryCount < 1)
return

val viewPortHandler = this.viewPortHandler

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.github.mikephil.charting.renderer.scatter

import android.graphics.Canvas
import android.graphics.Paint
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet
import com.github.mikephil.charting.utils.Utils
import com.github.mikephil.charting.utils.ViewPortHandler

class ChevronDownShapeRenderer : IShapeRenderer {
override fun renderShape(
canvas: Canvas, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler?,
posX: Float, posY: Float, renderPaint: Paint
) {
val shapeHalf = Utils.convertDpToPixel(dataSet.getScatterShapeSize()) / 2f

renderPaint.style = Paint.Style.STROKE
renderPaint.strokeWidth = Utils.convertDpToPixel(1f)

canvas.drawLine(
posX,
posY + (2 * shapeHalf),
posX + (2 * shapeHalf),
posY,
renderPaint
)

canvas.drawLine(
posX,
posY + (2 * shapeHalf),
posX - (2 * shapeHalf),
posY,
renderPaint
)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.github.mikephil.charting.renderer.scatter

import android.graphics.Canvas
import android.graphics.Paint
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet
import com.github.mikephil.charting.utils.Utils
import com.github.mikephil.charting.utils.ViewPortHandler

class ChevronUpShapeRenderer : IShapeRenderer {
override fun renderShape(
canvas: Canvas, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler?,
posX: Float, posY: Float, renderPaint: Paint
) {
val shapeHalf = Utils.convertDpToPixel(dataSet.getScatterShapeSize()) / 2f

renderPaint.style = Paint.Style.STROKE
renderPaint.strokeWidth = Utils.convertDpToPixel(1f)

canvas.drawLine(
posX,
posY - (2 * shapeHalf),
posX + (2 * shapeHalf),
posY,
renderPaint
)

canvas.drawLine(
posX,
posY - (2 * shapeHalf),
posX - (2 * shapeHalf),
posY,
renderPaint
)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.github.mikephil.charting.renderer.scatter

import android.graphics.Canvas
import android.graphics.Paint
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet
import com.github.mikephil.charting.utils.ColorTemplate
import com.github.mikephil.charting.utils.Utils
import com.github.mikephil.charting.utils.ViewPortHandler

class CircleShapeRenderer : IShapeRenderer {
override fun renderShape(
canvas: Canvas, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler?,
posX: Float, posY: Float, renderPaint: Paint
) {
val shapeSize = Utils.convertDpToPixel(dataSet.getScatterShapeSize())
val shapeHalf = shapeSize / 2f
val shapeHoleSizeHalf = Utils.convertDpToPixel(dataSet.getScatterShapeHoleRadius())
val shapeHoleSize = shapeHoleSizeHalf * 2f
val shapeStrokeSize = (shapeSize - shapeHoleSize) / 2f
val shapeStrokeSizeHalf = shapeStrokeSize / 2f

val shapeHoleColor = dataSet.getScatterShapeHoleColor()

if (shapeSize > 0.0) {
renderPaint.style = Paint.Style.STROKE
renderPaint.strokeWidth = shapeStrokeSize

canvas.drawCircle(
posX,
posY,
shapeHoleSizeHalf + shapeStrokeSizeHalf,
renderPaint
)

if (shapeHoleColor != ColorTemplate.COLOR_NONE) {
renderPaint.style = Paint.Style.FILL

renderPaint.color = shapeHoleColor
canvas.drawCircle(
posX,
posY,
shapeHoleSizeHalf,
renderPaint
)
}
} else {
renderPaint.style = Paint.Style.FILL

canvas.drawCircle(
posX,
posY,
shapeHalf,
renderPaint
)
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.mikephil.charting.renderer.scatter

import android.graphics.Canvas
import android.graphics.Paint
import com.github.mikephil.charting.interfaces.datasets.IScatterDataSet
import com.github.mikephil.charting.utils.Utils
import com.github.mikephil.charting.utils.ViewPortHandler

class CrossShapeRenderer : IShapeRenderer {
override fun renderShape(
canvas: Canvas, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler?,
posX: Float, posY: Float, renderPaint: Paint
) {
val shapeHalf = Utils.convertDpToPixel(dataSet.getScatterShapeSize()) / 2f

renderPaint.style = Paint.Style.STROKE
renderPaint.strokeWidth = Utils.convertDpToPixel(1f)

canvas.drawLine(
posX - shapeHalf,
posY,
posX + shapeHalf,
posY,
renderPaint
)
canvas.drawLine(
posX,
posY - shapeHalf,
posX,
posY + shapeHalf,
renderPaint
)
}
}

This file was deleted.

Loading
Loading