我正在寻找任何简单的代码示例,并解释如何为下方折线图的蓝色部分着色。我需要实现一个由三种颜色组成的渐变:金色、红色和深色。 这是我创建图表的代码:
let isUniformBy f xs =
xs
|> Seq.distinctBy f
|> Seq.tryExactlyOne
|> Option.isSome
有人能帮我吗?
答案 0 :(得分:0)
创建一个xml渐变
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:startColor="#9A0C0C"
android:centerColor="#CE9908"
android:endColor="#3091FF"
android:angle="270"/> </shape>
并设置数据集的setFillDrawable
Drawable drawable = ContextCompat.getDrawable(this, R.drawable.your_xml_name);
dataset.setFillDrawable(drawable);