Skip to content

Commit

Permalink
feat: Add simpler line function if user wants no settings (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviortheking authored Jan 13, 2023
1 parent 890d474 commit edd78e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions library/src/main/java/com/dzeio/charts/axis/YAxis.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ class YAxis(
lines[y] = line
}

override fun addLine(y: Float) {
this.addLine(y, Line())
}

override fun removeLine(y: Float) {
lines.remove(y)
}
Expand Down
11 changes: 9 additions & 2 deletions library/src/main/java/com/dzeio/charts/axis/YAxisInterface.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,18 @@ sealed interface YAxisInterface {
/**
* add a line on the Chart
*
* @param y the Y position of the line
* @param paint the Paint of the line if you want to have a custom one
* @param y the line's Y position
* @param line The line's settings
*/
fun addLine(y: Float, line: Line)

/**
* add a line on the Chart
*
* @param y the Y position of the line
*/
fun addLine(y: Float)

/**
* remove a line one the specified position
*
Expand Down

0 comments on commit edd78e8

Please # to comment.