我正在使用带有立方线图的achartengine,但它似乎没有用。立方线图不会通过系列中的所有点。在此示例中,图表远离点。我做错了什么,或者这是achartengine的实际问题?
代码:
XYMultipleSeriesDataset series = new XYMultipleSeriesDataset();
XYValueSeries newTicketSeries = new XYValueSeries("New Tickets");
newTicketSeries.add(1, 14);
newTicketSeries.add( 2, 12);
newTicketSeries.add(3, 18);
newTicketSeries.add( 4, 5);
newTicketSeries.add( 5, 10);
series.addSeries(newTicketSeries);
XYValueSeries fixedTicketSeries = new XYValueSeries("Fixed Tickets");
fixedTicketSeries.add( 1, 15);
fixedTicketSeries.add( 2, 5);
fixedTicketSeries.add( 3, 15);
fixedTicketSeries.add(4, 5);
fixedTicketSeries.add(5, 15);
series.addSeries(fixedTicketSeries);
XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
renderer.setAxisTitleTextSize(56);
renderer.setChartTitleTextSize(50);
renderer.setLabelsTextSize(55);
renderer.setZoomEnabled(true, false);
renderer.setPanEnabled(false, false);
renderer.setRange(new double[]{0, 10, 0, 20});
//renderer.setMargins(new int[] { 20, 30, 15, 0 });
XYSeriesRenderer newTicketRenderer = new XYSeriesRenderer();
newTicketRenderer.setColor(Color.argb(250, 0, 210, 250));
renderer.addSeriesRenderer(newTicketRenderer);
XYSeriesRenderer fixedTicketRenderer = new XYSeriesRenderer();
fixedTicketRenderer.setColor(Color.RED);
fixedTicketRenderer.setLineWidth(10);
fixedTicketRenderer.setPointStyle(PointStyle.CIRCLE);
fixedTicketRenderer.setFillPoints(true);
renderer.addSeriesRenderer(fixedTicketRenderer);
renderer.setPointSize(40);
renderer.setXLabels(0);
renderer.setYLabels(0);
newTicketRenderer.setDisplayChartValues(true);
newTicketRenderer.setChartValuesTextSize(30);
renderer.setShowGrid(false);
renderer.setShowLegend(true);
renderer.setShowLabels(false);
renderer.setBarSpacing(0.5);
renderer.setBackgroundColor(Color.TRANSPARENT);
renderer.setMarginsColor(Color.argb(0x00, 0x01, 0x01, 0x01));
//renderer.setZoomEnabled(false, false);
GraphicalView chartView;
String[] types = new String[] { BarChart.TYPE, CubicLineChart.TYPE};
chartView = ChartFactory.getCombinedXYChartView(getActivity(), series, renderer, types);