Java Code Examples for lecho.lib.hellocharts.view.ColumnChartView#setOnValueTouchListener()

The following examples show how to use lecho.lib.hellocharts.view.ColumnChartView#setOnValueTouchListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasalProfileEditor.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basal_profile_editor);
    JoH.fixActionBar(this);
    //  getSupportActionBar().setCustomView(R.layout.custom_action_bar_title);
    //  getSupportActionBar().setDisplayShowCustomEnabled(true);

    chart = (ColumnChartView) findViewById(R.id.basalChart);
    basalSelectSpinner = findViewById(R.id.basalProfileSpinner);
    basalStepSpinner = findViewById(R.id.basalStepSpinner);
    setValue = (EditText) findViewById(R.id.basalSetText);
    setButton = (Button) findViewById(R.id.basalSetButton);
    plusButton = (Button) findViewById(R.id.basalPlusButton);
    minusButton = (Button) findViewById(R.id.basalMinusButton);

    chart.setDataAnimationListener(this);
    chart.setOnValueTouchListener(new ValueTouchListener());
    chart.setColumnChartData(BasalChart.columnData());

    autoSetViewPort(true);
    refreshScreenElements();
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    //chart.setZoomLevel(0,0,1);
    chart.setMaxZoom(4f);
    chart.setZoomLevel(getNewMaxViewport().centerX(), getNewMaxViewport().centerY(), 1f);
    chart.setTapZoomEnabled(false);

    populateBasalStepSpinner();

}
 
Example 2
Source File: BasalProfileEditor.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_basal_profile_editor);
    JoH.fixActionBar(this);
    //  getSupportActionBar().setCustomView(R.layout.custom_action_bar_title);
    //  getSupportActionBar().setDisplayShowCustomEnabled(true);

    chart = (ColumnChartView) findViewById(R.id.basalChart);
    basalSelectSpinner = findViewById(R.id.basalProfileSpinner);
    basalStepSpinner = findViewById(R.id.basalStepSpinner);
    setValue = (EditText) findViewById(R.id.basalSetText);
    setButton = (Button) findViewById(R.id.basalSetButton);
    plusButton = (Button) findViewById(R.id.basalPlusButton);
    minusButton = (Button) findViewById(R.id.basalMinusButton);

    chart.setDataAnimationListener(this);
    chart.setOnValueTouchListener(new ValueTouchListener());
    chart.setColumnChartData(BasalChart.columnData());

    autoSetViewPort(true);
    refreshScreenElements();
    chart.setZoomType(ZoomType.HORIZONTAL);
    chart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    //chart.setZoomLevel(0,0,1);
    chart.setMaxZoom(4f);
    chart.setZoomLevel(getNewMaxViewport().centerX(), getNewMaxViewport().centerY(), 1f);
    chart.setTapZoomEnabled(false);

    populateBasalStepSpinner();

}
 
Example 3
Source File: ColumnChartActivity.java    From hellocharts-android with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView = inflater.inflate(R.layout.fragment_column_chart, container, false);

    chart = (ColumnChartView) rootView.findViewById(R.id.chart);
    chart.setOnValueTouchListener(new ValueTouchListener());

    generateData();

    return rootView;
}