MPAndroidChart XAxis lables

38 views Asked by At

I have a c# chart that looks like the image. I need to make something similar in MPAndroidChart 3.1.0. But I cannot figure out how to set the xaxis tick marks (0,600,1200...) and label ( Energy(KeV) ) .

enter image description here

enter image description here

Closer but I still can't figure out how to get the lables across the bottom of the xaxis.

enter image description here

 XAxis xAxis                 = chart.getXAxis();
    xAxis.setDrawGridLines        (true);
    xAxis.enableGridDashedLine    (10f, 10f, 0f);
    xAxis.setPosition             (XAxis.XAxisPosition.BOTTOM);
    //xAxis.setAxisMinimum           (0f);
    //xAxis.setAxisMaximum           (3000f); //this works but the line doesn't draw all the way across
    //xAxis.setLabelCount            (10);
    // xAxis.setDrawLabels           (true);
    xAxis.setTextColor            (Color.WHITE);
    xAxis.setTextSize             (12f);

I got it. Seems all you really had to do was setPosition, color and size

0

There are 0 answers