我正在使用 AchartEngine 绘制具有多条线的图形(折线图)。放大时,点之间的线消失,只有点保持可见。有人遇到过这样的问题吗?
代码没什么特别的。
XYMultipleSeriesDataset mDataset = new XYMultipleSeriesDataset(); XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
XYSeries IVseries=new XYValueSeries("IV");
XYSeries IV_stc_series=new XYValueSeries("IVstc");
for(double i=0;i<6;i=i+0.1){
IVseries.add(sin(i),cos(i));
IV_stc_series.add(2*sin(i),cos(i));
}
mDataset.addSeries(IVseries);
mDataset.addSeries(IV_stc_series);
XYSeriesRenderer IVrenderer = new XYSeriesRenderer ();
IVrenderer.setFillPoints(true);
IVrenderer.setPointStyle(PointStyle.TRIANGLE);
IVrenderer.setLineWidth(5);
IVrenderer.setColor(Color.GREEN);
mRenderer.addSeriesRenderer(IVrenderer);
XYSeriesRenderer IV_stc_renderer = new XYSeriesRenderer ();
IV_stc_renderer.setFillPoints(true);
IV_stc_renderer.setPointStyle(PointStyle.X);
IV_stc_renderer.setLineWidth(5);
IV_stc_renderer.setColor(Color.RED);
mRenderer.addSeriesRenderer(IV_stc_renderer);
mRenderer.setPanEnabled(true,true);
mRenderer.setZoomEnabled(true, true);
mRenderer.setZoomButtonsVisible(true);
mRenderer.setXLabels(20);
mRenderer.setYLabels(20);
mRenderer.setShowGrid(true);
mRenderer.setGridColor(Color.BLACK);
mRenderer.setApplyBackgroundColor(true);
mRenderer.setBackgroundColor(Color.WHITE);
mChartView = ChartFactory.getLineChartView(context, mDataset, mRenderer);
layout.addView(mChartView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));