Skip to content

Commit b512e32

Browse files
committed
clean comment
1 parent 4a18b83 commit b512e32

File tree

4 files changed

+34
-30
lines changed

4 files changed

+34
-30
lines changed

YChartsLib/src/main/java/co/yml/charts/ui/barchart/HorizontalBarChart.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import kotlinx.coroutines.launch
4141

4242

4343
/**
44-
* Horizontal bar chart
44+
* compose method for drawing Horizontal bar chart
4545
*
4646
* @param barChartData
4747
* @param modifier

YChartsLib/src/main/java/co/yml/charts/ui/barchart/StackedBarChart.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -330,28 +330,3 @@ fun StackedBarChart(
330330
}
331331
}
332332

333-
/**
334-
* @param barDataList : List of bar details for selected stacked bar
335-
* @param totalPaddingBtwBars : Total padding stacked bars
336-
* @param yOffset : Offset of Y axis point
337-
* @param yBottom : starting y offset of y Axis
338-
* @param xPointOffset : Offset of X axis point
339-
*/
340-
fun getFullBarDetails(
341-
barDataList: List<BarData>,
342-
totalPaddingBtwBars: Float,
343-
yOffset: Float,
344-
yBottom: Float,
345-
xPointOffset: Float
346-
): Pair<BarData, Offset> {
347-
var yPoint = 0f
348-
349-
barDataList.forEach {
350-
yPoint += it.point.y
351-
}
352-
val fullBarYOffset = yBottom - totalPaddingBtwBars - (yPoint * yOffset)
353-
val fullBarOffset = Offset(xPointOffset, fullBarYOffset)
354-
val fullBarData = BarData(Point(barDataList.first().point.x, yPoint))
355-
356-
return Pair(fullBarData, fullBarOffset)
357-
}

YChartsLib/src/main/java/co/yml/charts/ui/barchart/VerticalBarChart.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import kotlinx.coroutines.launch
3939

4040

4141
/**
42-
* Vertical bar chart
42+
* composable for drawing Vertical bar chart
4343
*
4444
* @param barChartData
4545
* @param modifier

YChartsLib/src/main/java/co/yml/charts/ui/barchart/utils.kt

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ internal fun DrawScope.highlightHorizontalBar(
194194
* @param paddingRight : Padding given at the end of the graph.
195195
* @param bgColor : Background of the rectangular mask.
196196
*/
197-
internal fun DrawScope.drawUnderXAxisScrollMask(columnWidth: Float, paddingTop: Dp, bgColor: Color) {
197+
internal fun DrawScope.drawUnderXAxisScrollMask(
198+
columnWidth: Float,
199+
paddingTop: Dp,
200+
bgColor: Color
201+
) {
198202
// Draw column to make graph look scrollable under Xaxis
199203
drawRect(
200204
bgColor, Offset(0f, size.height - columnWidth), Size(size.width, columnWidth)
@@ -280,11 +284,9 @@ internal fun getDrawHorizontalOffset(
280284
}
281285

282286

283-
284287
/////
285288

286289

287-
288290
/**
289291
*
290292
* Used to draw the highlighted text
@@ -465,4 +467,31 @@ internal fun DrawScope.drawUnderScrollMask(columnWidth: Float, paddingRight: Dp,
465467
Offset(size.width - paddingRight.toPx(), 0f),
466468
Size(paddingRight.toPx(), size.height)
467469
)
470+
}
471+
472+
473+
/**
474+
* @param barDataList : List of bar details for selected stacked bar
475+
* @param totalPaddingBtwBars : Total padding stacked bars
476+
* @param yOffset : Offset of Y axis point
477+
* @param yBottom : starting y offset of y Axis
478+
* @param xPointOffset : Offset of X axis point
479+
*/
480+
internal fun getFullBarDetails(
481+
barDataList: List<BarData>,
482+
totalPaddingBtwBars: Float,
483+
yOffset: Float,
484+
yBottom: Float,
485+
xPointOffset: Float
486+
): Pair<BarData, Offset> {
487+
var yPoint = 0f
488+
489+
barDataList.forEach {
490+
yPoint += it.point.y
491+
}
492+
val fullBarYOffset = yBottom - totalPaddingBtwBars - (yPoint * yOffset)
493+
val fullBarOffset = Offset(xPointOffset, fullBarYOffset)
494+
val fullBarData = BarData(Point(barDataList.first().point.x, yPoint))
495+
496+
return Pair(fullBarData, fullBarOffset)
468497
}

0 commit comments

Comments
 (0)