aChartEngine删除点之间的线

时间:2014-11-26 18:39:19

标签: android graph achartengine points

是否可以删除点之间的线?

这是我的代码:

  

public Intent execute(Context context){

String[] titles = new String[] { "Systolic Pressure", "Diastolic Pressure"};


List<double[]> x = new ArrayList<double[]>();
for (int i = 0; i < titles.length; i++) {
  x.add(new double[] { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60 });
}


List<double[]> values = new ArrayList<double[]>();
values.add(new double[] { 108, 110.5, 110, 115, 114, 118, 116, 119, 120, 125.3, 122.2, 123.9 });
values.add(new double[] { 75, 77, 80, 79, 82, 84, 83, 80, 86, 88, 85, 80 });

int[] colors = new int[] { Color.BLUE, Color.RED};
PointStyle[] styles = new PointStyle[] {PointStyle.TRIANGLE, PointStyle.TRIANGLE};
XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
setChartSettings(renderer, " ", " ", " ", 0, 60, 0, 250,Color.WHITE,Color.WHITE); 
renderer.setXLabels(12);
renderer.setYLabels(10);
renderer.setShowGridY(true);
renderer.setXLabelsAlign(Align.RIGHT);
renderer.setYLabelsAlign(Align.RIGHT);
renderer.setZoomButtonsVisible(true);
renderer.setPanLimits(new double[] { 0,60, 0, 250 });
renderer.setZoomLimits(new double[] { 0, 60, 0, 250});
XYMultipleSeriesDataset dataset = buildDataset(titles, x, values);
Intent intent = ChartFactory.getLineChartIntent(context, dataset, renderer,"Anesthesia Sheet");

return intent;   }

这里iti是图形结果:

enter image description here

2 个答案:

答案 0 :(得分:1)

使用散点图,而不是使用折线图。

变化:

Intent intent = ChartFactory.getLineChartIntent(context,dataset,renderer,&#34; Anesthesia Sheet&#34;);

要:

Intent intent = ChartFactory.getScatterChartIntent(context,dataset,renderer,&#34; Anesthesia Sheet&#34;);

我尝试将我的应用中的折线图切换为散点图,并且按预期工作 - 绘制的点没有连接线。

答案 1 :(得分:0)

我编辑了"%W",以尊重0条宽线。其差异看起来像这样:

"%V"