mirror of
https://github.com/dzeiocom/charts.git
synced 2025-07-29 16:29:53 +00:00
feat: Basic idea is present
This commit is contained in:
@ -125,7 +125,7 @@ class ChartFragment : Fragment() {
|
||||
binding.sliderXAxisScroll.visibility = View.VISIBLE
|
||||
} else {
|
||||
chart.xAxis.dataWidth = null
|
||||
chart.xAxis.x = 0.0
|
||||
chart.xAxis.setCurrentMin(0.0)
|
||||
binding.sliderXAxisScroll.visibility = View.GONE
|
||||
}
|
||||
chart.refresh()
|
||||
|
@ -72,6 +72,11 @@ class MainFragment : Fragment() {
|
||||
LineSerie(this).apply {
|
||||
entries = Utils.generateRandomDataset(5)
|
||||
}
|
||||
this.xAxis.keepGlobalLimits = true
|
||||
this.xAxis.zoomEnabled = true
|
||||
this.xAxis.scrollEnabled = true
|
||||
this.yAxis.zoomEnabled = true
|
||||
this.yAxis.scrollEnabled = true
|
||||
MaterialUtils.materielTheme(this, requireView())
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ import com.google.android.material.color.MaterialColors
|
||||
object MaterialUtils {
|
||||
fun materielTheme(chart: ChartViewInterface, view: View) {
|
||||
chart.yAxis.apply {
|
||||
textLabel.color =
|
||||
textPaint.color =
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorOnPrimaryContainer)
|
||||
linePaint.color =
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorOnPrimaryContainer)
|
||||
@ -17,8 +17,13 @@ object MaterialUtils {
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorError)
|
||||
}
|
||||
|
||||
chart.xAxis.textPaint.color =
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorOnPrimaryContainer)
|
||||
chart.xAxis.apply {
|
||||
textPaint.color =
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorOnPrimaryContainer)
|
||||
linePaint.color =
|
||||
MaterialColors.getColor(view, com.google.android.material.R.attr.colorOnPrimaryContainer)
|
||||
}
|
||||
|
||||
chart.annotator.apply {
|
||||
backgroundPaint.color = MaterialColors.getColor(
|
||||
view,
|
||||
|
@ -32,7 +32,7 @@
|
||||
<com.dzeio.charts.ChartView
|
||||
android:id="@+id/linechart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp" />
|
||||
android:layout_height="500dp" />
|
||||
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user