Closed nicolasmanurung closed 4 years ago
Hi,How do you solve this problem?
Hi,How do you solve this problem?
No, I'm stuck on there...
i did it.the first,you can copy the classes LineChartView.java and LineChartRenderer.java to your project from demo.then change the code
linePaint.setShader(line.getGradientToTransparent() ? new LinearGradient(0, 0, 0, canvas.getHeight(), line.getColor(), line.getColor() & 0x00ffffff, Shader.TileMode.MIRROR) : null);
to linePaint.setShader(new LinearGradient(0, 0, 0, canvas.getHeight(), line.getColor());
in LineChartRenderer.java
.and then ,you need import class :your local path.LineChartView.class in your local path.LineChartView.java.
and last,you need use class:your local path.LineChartView in your layout xml,
like:
<com.test.customView.LineChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</com.test.customView.LineChartView>
. it's over,good luck.
I have been implementing LineChart on Kotlin. But I cant go to setHasGradientToTransparent function