How can I draw a circle at a selected point in a line chart?

I use mpchart to draw diagrams. I need to increase the circle size of the intersection point of the selected and linear dataset. How can i achieve this?enter image description here

I read somewhere that we can add another dataset with a highlighted point and increase the size of the circle. Is this a really good approach if my marker drags back and forth and I have to update a new dataset very often?

+1
source share
1 answer

MpChart MarkerView, . MarkerView .

, ChartMarker MarkerView. , ​​ src .

public ChartMarker(Context context) {
    //the super will take care of displaying the layout
    super(context, R.layout.layout_dot);
}

, ChartMarker chart.setMarkerView()

ChartMarker elevationMarker = new ChartMarker(getActivity());
elevationChart.setMarkerView(elevationMarker);

layout_dot.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

<ImageView
    android:background="@drawable/dot"
    android:layout_width="5dp"
    android:layout_height="5dp" />

</LinearLayout>
+7

Source: https://habr.com/ru/post/1688664/


All Articles