How does Marker works when using XML and not compose #524
-
I had a question about the markers. I don't understand the documentation about it how I can use the markers. I'm using version 1.13.1 I'm using this chart: This is inside my Fragment now
This code will show a line chart with 2 tresholds and a line graph with gradient area. But I want also have the click function on the chart that show the marker. But I don't understand or is this not possible in xml. I don't see a property like enable marker or something. Only thing is Marker and add addPersistentMarker |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hello! This is described in the wiki. Please see the second paragraph here. |
Beta Was this translation helpful? Give feedback.
-
lines[0].lineColor = R.color or Color. By this you can set the color of the line |
Beta Was this translation helpful? Give feedback.
You can add a standard
Marker
by updatinglineChart.marker
, @DannyBloky. For example, if you’re creating yourMarker
viaMarkerComponent
, use the following:By the way, it looks like you’re recreating your
ChartEntryModelProducer
on every data update. This is discouraged and may cause unexpected behavior. I’d recommend using a singleChartEntryModelProducer
and storing it at a higher level.@csbenz,
LineChart
is a Vico 1 class. In Vico 2, useLineCartesianLayer
.