private void formatChart(final Resources res) {
        chart.setData(null);
        if (!entries.isEmpty()) {
            final LineDataSet dataSet = new LineDataSet(entries, null);
            dataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
            dataSet.setLineWidth(2f);
            final int color = res.getColor(R.color.colorAccent);
            dataSet.setColor(color);
            dataSet.setHighLightColor(res.getColor(R.color.colorTextHint));
            dataSet.setHighlightLineWidth(2.5f);
            dataSet.setValueTextColor(res.getColor(R.color.colorText));
            dataSet.setDrawValues(false);
            dataSet.setDrawFilled(true);
            dataSet.setFillColor(color);
            dataSet.setDrawCircles(false);

            final LineData lineData = new LineData(dataSet);
            chart.setData(lineData);
        }

        chart.setExtraOffsets(0, -30, 0, 10);
        chart.setBackgroundColor(res.getColor(R.color.colorBackground));

        final Legend legend = chart.getLegend();
        legend.setEnabled(false);
        chart.getDescription().setEnabled(false);

        final XAxis xAxis = chart.getXAxis();
        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
        xAxis.setDrawAxisLine(true);
        xAxis.setTextSize(getDimensionInDp(res, R.dimen.textSize_detailsSecondary));
        xAxis.setTextColor(res.getColor(R.color.colorText));
        xAxis.setAxisMinimum(0.0f);
        xAxis.setValueFormatter((value, axis) -> Units.getDistanceFromKilometers(value - offset));

        final YAxis yAxis = chart.getAxisLeft();
        yAxis.setDrawAxisLine(true);
        yAxis.setTextSize(getDimensionInDp(res, R.dimen.textSize_detailsSecondary));
        yAxis.setTextColor(res.getColor(R.color.colorText));

        final YAxis yAxis2 = chart.getAxisRight();
        yAxis2.setEnabled(false);
    }
format line chart (lines, axes etc.)
main/src/main/java/cgeo/geocaching/unifiedmap/layers/ElevationChart.java