jjoe64/GraphView

x axis label is being cut off at end

PanagiotisJunMobileDev opened this issue · 0 comments

GraphView graph1 = (GraphView) view.findViewById(R.id.graph01);
seriesAccLx = new LineGraphSeries<>();
seriesAccLy = new LineGraphSeries<>();
seriesAccLz = new LineGraphSeries<>();
graph1.addSeries(seriesAccLx);
graph1.addSeries(seriesAccLy);
graph1.addSeries(seriesAccLz);

        graph1.getLegendRenderer().setVisible(true);//more edit
        graph1.getLegendRenderer().setTextSize(40);
        graph1.getLegendRenderer().setAlign(LegendRenderer.LegendAlign.TOP);
        seriesAccLx.setColor(Color.RED);
        seriesAccLx.setTitle("AccLx");
        seriesAccLy.setColor(Color.GREEN);
        seriesAccLy.setTitle("AccLy");
        seriesAccLz.setColor(Color.BLUE);
        seriesAccLz.setTitle("AccLz");
        graph1.setTitle("accLx(Red) accLy(Green) accLz(Blue)");
        graph1.setTitleTextSize(30);
        graph1.getGridLabelRenderer().setHorizontalAxisTitle("timestamp");
        graph1.getGridLabelRenderer().setVerticalAxisTitle("AccL");

... and of course similar code for other graphs
----------------------------------------------------------------------XML Code

<FrameLayout
    android:id="@+id/line"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="3dp"
    android:background="#FFFFFF"
    android:gravity="center">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="3dp"
        android:background="#FFFFFF"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="16dp"
            android:text=""
            android:textSize="26sp"
            android:textStyle="bold" />


        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Displa Graphs"
            android:textAlignment="center"
            android:textAllCaps="false"
            android:textColor="#00BCD4"
            android:textSize="24sp"
            android:textStyle="bold|italic" />

        <com.jjoe64.graphview.GraphView
            android:id="@+id/graph01"
            android:layout_width="match_parent"
            android:layout_height="350dp"
            android:layout_marginEnd="3dp" />

        <com.jjoe64.graphview.GraphView
            android:id="@+id/graph02"
            android:layout_width="match_parent"
            android:layout_height="350dp"
            android:layout_marginEnd="3dp" />

        <com.jjoe64.graphview.GraphView
            android:id="@+id/graph03"
            android:layout_width="match_parent"
            android:layout_height="350dp"
            android:layout_marginEnd="3dp" />

        <com.jjoe64.graphview.GraphView
            android:id="@+id/graph04"
            android:layout_width="match_parent"
            android:layout_height="350dp"
            android:layout_marginEnd="3dp" />




</FrameLayout>