Richeek Dey
Richeek Dey

Reputation: 257

MPAndroid Chart connect different points on the scatterchart

[How I want it to look1

I have made a scatter plot with 3 different datasets. I want the lines between the points (in the same x-axis) to join such as to form the graph above. How it looks This is how it looks right now, all I wanna do is to join them by a line. Is it possible with MPAndroid chart? I am currently using that library.

I tried to use combinedchart, but the result is this:

enter image description here

Upvotes: 1

Views: 916

Answers (1)

Richeek Dey
Richeek Dey

Reputation: 257

Got it! I used a candlechart. That worked like a charm. Except I just had to put my high and low values.

CandleDataSet dataSet1 = new CandleDataSet(entries,"hr");

        CandleData candleData = new CandleData(time_steps,dataSet1);
        candleStickChart.setData(candleData);
        candleStickChart.setDrawGridBackground(false);
        candleStickChart.getAxisLeft().setDrawGridLines(false);
        candleStickChart.getXAxis().setDrawGridLines(false);
        candleStickChart.getAxisRight().setDrawGridLines(false);
        candleStickChart.setDrawBorders(false);
        candleStickChart.getXAxis().setTextColor(Color.parseColor("#FFF37D63"));
        candleStickChart.setBackgroundColor(Color.TRANSPARENT);


        candleStickChart.getLegend().setEnabled(false);
        candleStickChart.setDescription("");
        candleStickChart.getAxisLeft().setTextColor(Color.parseColor("#FFF37D63"));
        candleStickChart.getAxisRight().setEnabled(false);
        candleStickChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
        candleStickChart.setPinchZoom(false);
        candleStickChart.setDoubleTapToZoomEnabled(false);

Upvotes: 3

Related Questions