android中的Highchart渲染速度慢

android中的Highchart渲染速度慢,android,android-studio,highcharts,Android,Android Studio,Highcharts,我正在android上工作,并试图创建一个速度表。通过以下示例,我可以查看车速表 <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http:

我正在android上工作,并试图创建一个
速度表
。通过以下示例,我可以查看
车速表

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<com.highsoft.highcharts.core.HIChartView
    android:id="@+id/hc"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

如上图所示,速度表可能在应用程序执行后2-3秒后渲染。我记得有一次在web应用程序上使用
highcharts
时,有一个设置选项。但是我在android中找不到它,尽管我添加了
HIPlotOptions plotOptions=new HIPlotOptions()但是没有运气


如何最大限度地减少渲染时间?任何帮助都将不胜感激。

更复杂的图表将运行“较慢”。你可以做两件事,要么应用“boost”模块,要么通过Google Play在手机上更新WebView。

我还没有测试过,但是,你有没有在他们的论坛中检查过这个或任何其他条目?
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    HIChartView chartView = findViewById(R.id.hc);

    HIOptions options = new HIOptions();
    HIChart chart = new HIChart();
    chart.setType("gauge");
    chart.setPlotBorderWidth(0);
    chart.setPlotShadow(false);
    options.setChart(chart);

    HITitle title = new HITitle();
    title.setText("Speedometer");
    options.setTitle(title);

    HIPane pane = new HIPane();
    pane.setStartAngle(-150);
    pane.setEndAngle(150);
    HIBackground background1 = new HIBackground();
    HIGradient gradient = new HIGradient();
    LinkedList<HIStop> stops = new LinkedList<>();
    stops.add(new HIStop(0, HIColor.initWithHexValue("FFF")));
    stops.add(new HIStop(1, HIColor.initWithHexValue("333")));
    background1.setBackgroundColor(HIColor.initWithLinearGradient(gradient, stops));
    background1.setBorderWidth(0);
    background1.setOuterRadius("109%");
    HIBackground background2 = new HIBackground();
    background2.setBackgroundColor(HIColor.initWithLinearGradient(gradient, stops));
    background2.setBorderWidth(1);
    background2.setOuterRadius("107%");
    HIBackground background3 = new HIBackground();
    HIBackground background4 = new HIBackground();
    background4.setBackgroundColor(HIColor.initWithHexValue("DDD"));
    background4.setBorderWidth(0);
    background4.setOuterRadius("105%");
    background4.setInnerRadius("103%");
    pane.setBackground(new ArrayList<>(Arrays.asList(background1, background2, background3, background4)));
    options.setPane(pane);

    HIYAxis yaxis = new HIYAxis();
    yaxis.setMin(-100);
    yaxis.setMax(100);
    yaxis.setMinorTickWidth(1);
    yaxis.setMinorTickLength(10);
    yaxis.setMinorTickPosition("inside");
    yaxis.setMinorTickColor(HIColor.initWithHexValue("666"));
    yaxis.setTickPixelInterval(30);
    yaxis.setTickWidth(2);
    yaxis.setTickPosition("inside");
    yaxis.setTickLength(10);
    yaxis.setTickColor(HIColor.initWithHexValue("666"));
    yaxis.setLabels(new HILabels());
    yaxis.getLabels().setStep(2);
    yaxis.setTitle(new HITitle());
    yaxis.getTitle().setText("km/h");

    HIPlotBands plotband1 = new HIPlotBands();
    plotband1.setFrom(-100);
    plotband1.setTo(-50);
    plotband1.setColor(HIColor.initWithName("Red"));

    HIPlotBands plotband2 = new HIPlotBands();
    plotband2.setFrom(-50);
    plotband2.setTo(0);
    plotband2.setColor(HIColor.initWithName("Yellow"));

    HIPlotBands plotband3 = new HIPlotBands();
    plotband3.setFrom(0);
    plotband3.setTo(50);
    plotband3.setColor(HIColor.initWithName("Blue"));

    HIPlotBands plotband4 = new HIPlotBands();
    plotband4.setFrom(50);
    plotband4.setTo(100);
    plotband4.setColor(HIColor.initWithName("Green"));

    yaxis.setPlotBands(new ArrayList<>(Arrays.asList(plotband1, plotband2, plotband3,plotband4)));
    options.setYAxis(new ArrayList<>(Collections.singletonList(yaxis)));

    HIGauge gauge = new HIGauge();
    gauge.setName("Speed");
    gauge.setTooltip(new HITooltip());
    gauge.getTooltip().setValueSuffix(" km/h");
    gauge.setData(new ArrayList<>(Collections.singletonList(80)));

    options.setSeries(new ArrayList<>(Collections.singletonList(gauge)));

    chartView.setOptions(options);

}
}