// Path: app/libs/MPAndroidChart-2.2.3/MPAndroidChart-2.2.3/MPChartExample/src/com/xxmassdeveloper/mpchartexample/custom/MyValueFormatter.java
// public class MyValueFormatter implements ValueFormatter {
// 
//     private DecimalFormat mFormat;
//     
//     public MyValueFormatter() {
//         mFormat = new DecimalFormat("###,###,###,##0.0");
//     }
// 
//     @Override
//     public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
//         return mFormat.format(value) + " $";
//     }
// }
// 
// Path: app/libs/MPAndroidChart-2.2.3/MPAndroidChart-2.2.3/MPChartExample/src/com/xxmassdeveloper/mpchartexample/custom/MyYAxisValueFormatter.java
// public class MyYAxisValueFormatter implements YAxisValueFormatter {
// 
//     private DecimalFormat mFormat;
// 
//     public MyYAxisValueFormatter() {
//         mFormat = new DecimalFormat("###,###,###,##0.0");
//     }
// 
//     @Override
//     public String getFormattedValue(float value, YAxis yAxis) {
//         return mFormat.format(value) + " $";
//     }
// }


import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import com.github.mikephil.charting.charts.BarChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.Legend.LegendPosition;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.XAxis.XAxisPosition;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.filter.Approximator;
import com.github.mikephil.charting.data.filter.Approximator.ApproximatorType;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.xxmassdeveloper.mpchartexample.custom.MyValueFormatter;
import com.xxmassdeveloper.mpchartexample.custom.MyYAxisValueFormatter;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;
import java.util.ArrayList;
import java.util.List;
	@Override
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

		tvX.setText("" + (mSeekBarX.getProgress() + 1));
		tvY.setText("" + (mSeekBarY.getProgress()));

		ArrayList<String> xVals = new ArrayList<String>();
		for (int i = 0; i < mSeekBarX.getProgress() + 1; i++) {
			xVals.add(mMonths[i % mMonths.length]);
		}

		ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();

		for (int i = 0; i < mSeekBarX.getProgress() + 1; i++) {
			float mult = (mSeekBarY.getProgress() + 1);
			float val1 = (float) (Math.random() * mult) + mult / 3;
			float val2 = (float) (Math.random() * mult) + mult / 3;
			float val3 = (float) (Math.random() * mult) + mult / 3;

			yVals1.add(new BarEntry(new float[] { val1, val2, val3 }, i));
		}

		BarDataSet set1 = new BarDataSet(yVals1, "Statistics Vienna 2014");
		set1.setColors(getColors());
		set1.setStackLabels(new String[] { "Births", "Divorces", "Marriages" });

		ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
		dataSets.add(set1);

		BarData data = new BarData(xVals, dataSets);
// Path: app/libs/MPAndroidChart-2.2.3/MPAndroidChart-2.2.3/MPChartExample/src/com/xxmassdeveloper/mpchartexample/custom/MyValueFormatter.java
// public class MyValueFormatter implements ValueFormatter {
// 
//     private DecimalFormat mFormat;
//     
//     public MyValueFormatter() {
//         mFormat = new DecimalFormat("###,###,###,##0.0");
//     }
// 
//     @Override
//     public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
//         return mFormat.format(value) + " $";
//     }
// }
// 
// Path: app/libs/MPAndroidChart-2.2.3/MPAndroidChart-2.2.3/MPChartExample/src/com/xxmassdeveloper/mpchartexample/custom/MyYAxisValueFormatter.java
// public class MyYAxisValueFormatter implements YAxisValueFormatter {
// 
//     private DecimalFormat mFormat;
// 
//     public MyYAxisValueFormatter() {
//         mFormat = new DecimalFormat("###,###,###,##0.0");
//     }
// 
//     @Override
//     public String getFormattedValue(float value, YAxis yAxis) {
//         return mFormat.format(value) + " $";
//     }
// }


// Path: app/libs/MPAndroidChart-2.2.3/MPAndroidChart-2.2.3/MPChartExample/src/com/xxmassdeveloper/mpchartexample/StackedBarActivity.java
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import com.github.mikephil.charting.charts.BarChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.Legend.LegendPosition;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.XAxis.XAxisPosition;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.filter.Approximator;
import com.github.mikephil.charting.data.filter.Approximator.ApproximatorType;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.xxmassdeveloper.mpchartexample.custom.MyValueFormatter;
import com.xxmassdeveloper.mpchartexample.custom.MyYAxisValueFormatter;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;
import java.util.ArrayList;
import java.util.List;

	@Override
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

		tvX.setText("" + (mSeekBarX.getProgress() + 1));
		tvY.setText("" + (mSeekBarY.getProgress()));

		ArrayList<String> xVals = new ArrayList<String>();
		for (int i = 0; i < mSeekBarX.getProgress() + 1; i++) {
			xVals.add(mMonths[i % mMonths.length]);
		}

		ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();

		for (int i = 0; i < mSeekBarX.getProgress() + 1; i++) {
			float mult = (mSeekBarY.getProgress() + 1);
			float val1 = (float) (Math.random() * mult) + mult / 3;
			float val2 = (float) (Math.random() * mult) + mult / 3;
			float val3 = (float) (Math.random() * mult) + mult / 3;

			yVals1.add(new BarEntry(new float[] { val1, val2, val3 }, i));
		}

		BarDataSet set1 = new BarDataSet(yVals1, "Statistics Vienna 2014");
		set1.setColors(getColors());
		set1.setStackLabels(new String[] { "Births", "Divorces", "Marriages" });

		ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
		dataSets.add(set1);

		BarData data = new BarData(xVals, dataSets);
		data.setValueFormatter(new MyValueFormatter());