看到下面的圖片。梯度被錯誤地繪製,並且垂直的黑色線條是醜陋的。如何設置「絕對」區域漸變?
- 如何創建從
min
延伸到max
的漸變?例如。如果我有從0到100的比例,我希望我的區域使用這些0..100個梯度值中的N個。 - 如何去除垂直黑線?
UPDATE:所提供的答案的作品,但我得到這個神器:
更新2:使用時,這只是發生如圖所示ONE LinearLayout
如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chart_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="3dip" >
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
然後將TChart
添加到chart_layout
。巴姆!偏移錯誤:)
很抱歉,但我忘了問你,如果你能解釋一下你想要達到什麼目的,因爲我們清楚你的目標是什麼。 謝謝, –
我希望漸變從最小值漸變到最大值(在這種情況下爲0到100)。所以在上面的圖片中,80點將會有第80個漸變顏色(幾乎是綠色)。 50點的顏色將爲第50梯度顏色(黃色)。我相信你需要一個新的漸變類型:'SYMMETRICRECTGRADIENT'。 – l33t
這很容易在Excel中生成。只需使用線性漸變填充顏色創建面積圖即可。此外,它支持梯度的多個停止。這也是必須的:/ – l33t