Skip to content

Commit

Permalink
优化蜡烛图某个点4中价格一样的显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyiqian committed Dec 9, 2021
1 parent cdeb835 commit 3b8237f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,17 @@ open class KChart(
tmpRectF.right = left + barWidth
tmpRectF.bottom = kEntity.getClosePrice()
mapRectValue2Real(tmpRectF)
canvas.drawRect(tmpRectF, candleKChartPaint)
if (tmpRectF.height() == 0f) {
canvas.drawLine(
tmpRectF.left,
tmpRectF.top,
tmpRectF.right,
tmpRectF.bottom,
candleKChartPaint
)
} else {
canvas.drawRect(tmpRectF, candleKChartPaint)
}
}
left += barWidth + spaceWidth
}
Expand Down
4 changes: 2 additions & 2 deletions samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android:flexbox:2.0.1'

// implementation project(':lib')
implementation 'com.github.wangyiqian:StockChart:1.0.10'
implementation project(':lib')
// implementation 'com.github.wangyiqian:StockChart:1.0.10'
}

0 comments on commit 3b8237f

Please sign in to comment.