Code: Select all
HIChartView chartView = findViewById(R.id.chartview1);
TextView loadingView = findViewById(R.id.loading);
HIOptions options = new HIOptions();
final Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(new Runnable() {
@Override
public void run() {
HILine series1 = new HILine();
Number[] series1_data = new Number[] {1, 2, 3, 2, 4};
series1.setData(new ArrayList<>(Arrays.asList(series1_data)));
options.setSeries(new ArrayList<>(Arrays.asList(series1)));
chartView.setOptions(options);
chartView.setVisibility(View.VISIBLE);
loadingView.setVisibility(View.GONE);
}
}, 1500);
Code: Select all
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.highsoft.highcharts.core.HIChartView
android:visibility="gone"
android:gravity="center"
android:layout_width="match_parent"
android:id="@+id/chartview1"
android:layout_height="500dp"/>
<TextView
android:id="@+id/loading"
android:text="Loading..."
android:textSize="40sp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>