I'm using Androidplot to create my charts.
I want to use the
oneChart.setDomainStep(XYStepMode.INCREMENT_BY_VAL, 1);
command but everytime I run my app and want to draw a graph the app crashes after blackscreen. how to fix this?
No exception or error is thrown in logcat.
If I use the SUBDIVIDE everything works fine.
More Code:
XYPlot oneChart = (XYPlot) findViewById(R.id.oneChart);
XYSeries[] series = new SimpleXYSeries(
Arrays.asList(nX),
Arrays.asList(nY),
getTitle);
oneChart.disableAllMarkup();
oneChart.getGraphWidget().setMarginTop(10);
oneChart.getGraphWidget().setMarginRight(30);
oneChart.getGraphWidget().getGridBackgroundPaint().setColor(Color.LTGRAY);
oneChart.getGraphWidget().getGridLinePaint().setColor(Color.BLACK);
oneChart.getGraphWidget().getDomainOriginLinePaint().setColor(Color.BLACK);
oneChart.getGraphWidget().getRangeOriginLinePaint().setColor(Color.BLACK);
oneChart.getGraphWidget().getGridLinePaint().setPathEffect(new DashPathEffect(new float[]{1,1}, 1));
oneChart.getBorderPaint().setStrokeWidth(1);
oneChart.getBorderPaint().setAntiAlias(true);
oneChart.getBorderPaint().setColor(Color.LTGRAY);
LineAndPointFormatter seriesFormat = new LineAndPointFormatter(
Color.rgb(0, 0, 200), // line color
Color.rgb(0, 0, 100), // point color
Color.rgb(100, 100, 240)); // fill color (optional)
Paint lineFill = new Paint();
lineFill.setAlpha(200);
lineFill.setShader(new LinearGradient(0, 0, 0, 250, Color.WHITE, Color.BLUE, Shader.TileMode.CLAMP));
seriesFormat.setFillPaint(lineFill);
oneChart.addSeries(series, seriesFormat);
