如何使用JFreeChart库创建空心饼图

时间:2017-11-10 07:17:32

标签: java jfreechart

如何使用JFreeChart库创建空心饼图?

如果使用JFreeChart无法实现,那么任何人都可以推荐一个我可以用来创建空心饼图的库,如下例所示:

example hollow pie chart]

1 个答案:

答案 0 :(得分:1)

它可能在JFreeChart中,尝试这样的事情。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="true"
    android:background="@drawable/icehockey_bg"
    android:orientation="horizontal">

    <FrameLayout
        android:clickable="true"
        android:id="@+id/fragment_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
        <RelativeLayout
            android:clickable="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/match_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:text="Match Name"
                android:textAllCaps="true"
                android:textSize="20sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/timer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:text="02:00"
                android:textColor="#000000"
                android:textSize="20sp"
                android:textStyle="bold" />

          <Button
                android:id="@+id/back_btn_game_view"
                android:layout_width="70dp"
                android:layout_height="wrap_content"
                android:adjustViewBounds="true"
                android:clickable="true"
                android:cropToPadding="true"
                android:scaleType="fitXY"
                android:src="@drawable/ic_back_button" />
        </RelativeLayout>
    </FrameLayout>
</LinearLayout>

输出将是

enter image description here

相关问题