Skip to content

Commit

Permalink
增加配置
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyiqian committed Feb 24, 2022
1 parent 95ad5f6 commit c1f4e1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const val DEFAULT_GRID_HORIZONTAL_LINE_COUNT = 0
const val DEFAULT_GRID_VERTICAL_LINE_COUNT = 0
val DEFAULT_GRID_LINE_COLOR = Color.parseColor("#676767")
const val DEFAULT_GRID_LINE_STROKE_WIDTH = 1f
const val DEFAULT_VALUE_TEND_TO_ZERO = 0.0001f

// K线图
const val DEFAULT_K_CHART_LINE_CHART_COLOR = Color.WHITE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class StockChartConfig {
// 背景网格线条宽度
var gridLineStrokeWidth = DEFAULT_GRID_LINE_STROKE_WIDTH

var valueTendToZero = DEFAULT_VALUE_TEND_TO_ZERO

// 加载更多监听
var onLoadMoreListener: OnLoadMoreListener? = null
set(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ open class KChart(
}
}

if (abs(yMin - yMax) > 0.0001) {
if (abs(yMin - yMax) > stockChart.getConfig().valueTendToZero) {
result[0] = yMin
result[1] = yMax
} else { // 约等于0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class KdjChart(stockChart: IStockChart, chartConfig: KdjChartConfig) :
}
}

if (abs(yMin - yMax) > 0.0001) {
if (abs(yMin - yMax) > stockChart.getConfig().valueTendToZero) {
result[0] = yMin
result[1] = yMax
} else { // 约等于0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MacdChart(
}
}

if (abs(yMin - yMax) > 0.0001) {
if (abs(yMin - yMax) > stockChart.getConfig().valueTendToZero) {
result[0] = yMin
result[1] = yMax
} else { // 约等于0
Expand Down

0 comments on commit c1f4e1f

Please sign in to comment.