// Path: app/src/main/java/com/jjoe64/graphview_demos/FullscreenActivity.java
// public class FullscreenActivity extends AppCompatActivity {
//     private BaseExample mLogic;
// 
//     @Override
//     public void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         String name = getIntent().getStringExtra(FullscreenExample.ARG_ID);
//         FullscreenExample example = FullscreenExample.valueOf(name);
// 
//         setContentView(example.contentView);
//         try {
//             mLogic = example.exampleClass.newInstance();
//             mLogic.onCreate(this);
//         } catch (InstantiationException e) {
//             e.printStackTrace();
//         } catch (IllegalAccessException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mLogic.onResume();
//     }
// 
//     @Override
//     protected void onPause() {
//         mLogic.onPause();
//         super.onPause();
//     }
// 
//     @Override
//     public void onRequestPermissionsResult(int requestCode,
//                                            String permissions[], int[] grantResults) {
//         switch (requestCode) {
//             case SnapshotShareGraph.REQUEST_CODE_PERMISSION: {
//                 // If request is cancelled, the result arrays are empty.
//                 if (grantResults.length > 0
//                         && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// 
//                     SnapshotShareGraph example = (SnapshotShareGraph) mLogic;
//                     example.snapshot();
// 
//                 } else {
//                     Toast.makeText(this, "Permission denied. Not possible to show example.", Toast.LENGTH_SHORT).show();
//                 }
//                 return;
//             }
//         }
//     }
// 
// }


import android.graphics.Color;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
import com.jjoe64.graphview_demos.FullscreenActivity;
import com.jjoe64.graphview_demos.R;
package com.jjoe64.graphview_demos.examples;



/**
 * Created by jonas on 10.09.16.
 */
public class TitlesExample extends BaseExample {
    @Override
    public void onCreate(FullscreenActivity activity) {
        GraphView graph = (GraphView) activity.findViewById(R.id.graph);
        initGraph(graph);
    }

    @Override
    public void initGraph(GraphView graph) {
        LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
                new DataPoint(0, 1),
                new DataPoint(1, 5),
                new DataPoint(2, 3),
                new DataPoint(3, 2),
                new DataPoint(4, 6)
        });
        graph.addSeries(series);

        // titles
        graph.setTitle("Chart Title");
        graph.getGridLabelRenderer().setVerticalAxisTitle("Vertical Axis");
// Path: app/src/main/java/com/jjoe64/graphview_demos/FullscreenActivity.java
// public class FullscreenActivity extends AppCompatActivity {
//     private BaseExample mLogic;
// 
//     @Override
//     public void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         String name = getIntent().getStringExtra(FullscreenExample.ARG_ID);
//         FullscreenExample example = FullscreenExample.valueOf(name);
// 
//         setContentView(example.contentView);
//         try {
//             mLogic = example.exampleClass.newInstance();
//             mLogic.onCreate(this);
//         } catch (InstantiationException e) {
//             e.printStackTrace();
//         } catch (IllegalAccessException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     @Override
//     protected void onResume() {
//         super.onResume();
//         mLogic.onResume();
//     }
// 
//     @Override
//     protected void onPause() {
//         mLogic.onPause();
//         super.onPause();
//     }
// 
//     @Override
//     public void onRequestPermissionsResult(int requestCode,
//                                            String permissions[], int[] grantResults) {
//         switch (requestCode) {
//             case SnapshotShareGraph.REQUEST_CODE_PERMISSION: {
//                 // If request is cancelled, the result arrays are empty.
//                 if (grantResults.length > 0
//                         && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// 
//                     SnapshotShareGraph example = (SnapshotShareGraph) mLogic;
//                     example.snapshot();
// 
//                 } else {
//                     Toast.makeText(this, "Permission denied. Not possible to show example.", Toast.LENGTH_SHORT).show();
//                 }
//                 return;
//             }
//         }
//     }
// 
// }


// Path: app/src/main/java/com/jjoe64/graphview_demos/examples/TitlesExample.java
import android.graphics.Color;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
import com.jjoe64.graphview_demos.FullscreenActivity;
import com.jjoe64.graphview_demos.R;

package com.jjoe64.graphview_demos.examples;



/**
 * Created by jonas on 10.09.16.
 */
public class TitlesExample extends BaseExample {
    @Override
    public void onCreate(FullscreenActivity activity) {
        GraphView graph = (GraphView) activity.findViewById(R.id.graph);
        initGraph(graph);
    }

    @Override
    public void initGraph(GraphView graph) {
        LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[] {
                new DataPoint(0, 1),
                new DataPoint(1, 5),
                new DataPoint(2, 3),
                new DataPoint(3, 2),
                new DataPoint(4, 6)
        });
        graph.addSeries(series);

        // titles
        graph.setTitle("Chart Title");
        graph.getGridLabelRenderer().setVerticalAxisTitle("Vertical Axis");
        graph.getGridLabelRenderer().setHorizontalAxisTitle("Horizontal Axis");