AnyChart不显示进度条

时间:2018-05-21 12:39:20

标签: android progress-bar anychart

工具栏未在图表之前加载!

参考此answer

AnyChartView anyChartView = x.findViewById(R.id.any_chart_view);
    pbar = x.findViewById(R.id.progressBar);
    anyChartView.setProgressBar(pbar);
    FirebaseFirestore db = FirebaseFirestore.getInstance();

    final TagCloud tagCloud = AnyChart.tagCloud();

    tagCloud.setTitle("Programming statisctics");

    OrdinalColor ordinalColor = new OrdinalColor();
    ordinalColor.setColors(new String[] {
            "#26959f", "#f18126", "#3b8ad8", "#60727b", "#e24b26"
    });
    tagCloud.setColorScale(ordinalColor);
    tagCloud.setAngles(new Double[] {-90d, 0d, 90d});

    tagCloud.getColorRange().setEnabled(true);
    tagCloud.getColorRange().setColorLineSize(15d);
   final List<Integer> list = new ArrayList<>();
    list.add(1383220000);
    list.add(1383220000);
    list.add(1316000000);
    list.add(324982000);
    list.add(263510000);
    db.collection("jobs")...
    anyChartView.setChart(tagCloud);

根据我的尝试:进度条类型无关紧要,如果我设置View.Visible也不重要。

我正在使用TagCloud tagCloud = AnyChart.tagCloud(); 更新:布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.dell.ora.ChartFragment">

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />


    <com.anychart.anychart.AnyChartView
    android:id="@+id/any_chart_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    </com.anychart.anychart.AnyChartView>

</RelativeLayout>

如果有人遇到此问题,请分享您是如何解决的!

1 个答案:

答案 0 :(得分:0)

根据您的代码,progressBar在anyChartView下呈现。您所需要的只是改变元素的顺序。请尝试以下代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.dell.ora.ChartFragment">

    <com.anychart.anychart.AnyChartView
        android:id="@+id/any_chart_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

  <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</RelativeLayout>
相关问题