mirror of
https://github.com/dzeiocom/charts.git
synced 2025-06-08 00:59:56 +00:00
feat: Implement recent changes in the sample app
This commit is contained in:
parent
58314603ec
commit
55948edc83
@ -67,8 +67,8 @@ class MainFragment : Fragment() {
|
|||||||
materielTheme(this, requireView())
|
materielTheme(this, requireView())
|
||||||
|
|
||||||
// give the series their entries
|
// give the series their entries
|
||||||
serie2.entries = generateRandomDataset(20, 20, 80)
|
serie2.entries = generateRandomDataset(20, -50, 50)
|
||||||
serie1.entries = generateRandomDataset(20, 0, 90).apply {
|
serie1.entries = generateRandomDataset(20, -50, 50).apply {
|
||||||
for (idx in 0 until size) {
|
for (idx in 0 until size) {
|
||||||
val compared = serie2.entries[idx]
|
val compared = serie2.entries[idx]
|
||||||
val toCompare = this[idx]
|
val toCompare = this[idx]
|
||||||
@ -89,8 +89,12 @@ class MainFragment : Fragment() {
|
|||||||
serie2.linePaint.strokeWidth = 10f
|
serie2.linePaint.strokeWidth = 10f
|
||||||
|
|
||||||
yAxis.apply {
|
yAxis.apply {
|
||||||
|
// Enable vertical scrolling
|
||||||
|
scrollEnabled = true
|
||||||
|
|
||||||
// change the number of labels
|
// change the number of labels
|
||||||
labelCount = 10
|
labelCount = 10
|
||||||
|
|
||||||
// change how labels are displayed
|
// change how labels are displayed
|
||||||
onValueFormat = { "${it.roundToInt()}g"}
|
onValueFormat = { "${it.roundToInt()}g"}
|
||||||
|
|
||||||
@ -102,11 +106,14 @@ class MainFragment : Fragment() {
|
|||||||
linePaint.color = Color.WHITE
|
linePaint.color = Color.WHITE
|
||||||
|
|
||||||
// change the min/max high
|
// change the min/max high
|
||||||
setYMin(15f)
|
setYMin(-20f)
|
||||||
setYMax(80f)
|
setYMax(20f)
|
||||||
}
|
}
|
||||||
|
|
||||||
xAxis.apply {
|
xAxis.apply {
|
||||||
|
// Enable horizontal scrolling
|
||||||
|
scrollEnabled = true
|
||||||
|
|
||||||
// set the width of the datas
|
// set the width of the datas
|
||||||
dataWidth = 10.0
|
dataWidth = 10.0
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.MainFragment">
|
tools:context=".ui.MainFragment">
|
||||||
|
|
||||||
<ScrollView
|
<!-- <ScrollView-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="match_parent">
|
<!-- android:layout_height="match_parent">-->
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -22,18 +22,18 @@
|
|||||||
android:layout_height="200dp" />
|
android:layout_height="200dp" />
|
||||||
|
|
||||||
<com.dzeio.charts.ChartView
|
<com.dzeio.charts.ChartView
|
||||||
android:id="@+id/chart2"
|
android:id="@+id/chart3"
|
||||||
android:layout_marginVertical="16dp"
|
android:layout_marginVertical="16dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp" />
|
android:layout_height="200dp" />
|
||||||
|
|
||||||
<com.dzeio.charts.ChartView
|
<com.dzeio.charts.ChartView
|
||||||
android:id="@+id/chart3"
|
android:id="@+id/chart2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp" />
|
android:layout_height="200dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
<!-- </ScrollView>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user