1

Just trying to add some spacing to the X-axis title so that it's not so cluttered. Specifically the text "Time".

I have already tried the padding setting as you can see.

Image is here:

<com.jjoe64.graphview.GraphView
        android:id="@+id/bar_graph"
        android:layout_width="match_parent"
        android:layout_height="200dip"
        android:layout_below="@+id/toolbar"
        android:layout_marginRight="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="75dp" />
 //set scale
        bar_Graph.getViewport().setMinX(0);
        bar_Graph.getViewport().setMaxX(7);
        bar_Graph.getViewport().setMinY(0);

        bar_Graph.getViewport().setYAxisBoundsManual(true);
        bar_Graph.getViewport().setXAxisBoundsManual(true);

        GridLabelRenderer gridLabel = bar_Graph.getGridLabelRenderer();
        gridLabel.setHorizontalAxisTitle("Time");
        gridLabel.setVerticalAxisTitle("Ticket Redemptions");

        gridLabel.setPadding(50);

        //space bars
        barGraph_Data.setSpacing(20);

        // GraphView 4.x
        StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(bar_Graph);
        staticLabelsFormatter.setHorizontalLabels(new String[] {"","11", "11:30","12", "12:30", "1", "1:30",""});
//        staticLabelsFormatter.setVerticalLabels(new String[] {"low", "middle", "high"});
        bar_Graph.getGridLabelRenderer().setLabelFormatter(staticLabelsFormatter);
Zoe
  • 27,060
  • 21
  • 118
  • 148

0 Answers0