当前位置: 首页>>代码示例>>Java>>正文


Java Chart.setTouchEnabled方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.charts.Chart.setTouchEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Chart.setTouchEnabled方法的具体用法?Java Chart.setTouchEnabled怎么用?Java Chart.setTouchEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.charts.Chart的用法示例。


在下文中一共展示了Chart.setTouchEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
/**
 * 设置字体
 *
 * @param chart
 */
protected void setup(Chart<?> chart) {
    mTy = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
    chart.setDescription("");
    chart.setNoDataTextDescription("You need to provide data for the chart.");
    chart.setTouchEnabled(true);
    if (chart instanceof BarLineChartBase) {
        BarLineChartBase mChart = (BarLineChartBase) chart;
        mChart.setDrawGridBackground(false);
        mChart.setDragEnabled(true);
        mChart.setScaleEnabled(true);
        mChart.setPinchZoom(false);
        YAxis leftAxis = mChart.getAxisLeft();
        leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
        leftAxis.setTypeface(mTy);
        leftAxis.setTextSize(8f);
        leftAxis.setTextColor(Color.WHITE);
        XAxis xAxis = mChart.getXAxis();
        xAxis.setLabelRotationAngle(-50);//设置x轴字体显示角度
        xAxis.setTypeface(mTy);
        xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
        xAxis.setTextSize(8f);
        xAxis.setTextColor(Color.WHITE);
        mChart.getAxisRight().setEnabled(false);
    }
}
 
开发者ID:dscn,项目名称:ktball,代码行数:31,代码来源:SchoolAllPeopleDetailAcitivty.java

示例2: setup

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void setup(Chart<?> chart) {

        mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

        // no description text
        chart.getDescription().setEnabled(false);

        // enable touch gestures
        chart.setTouchEnabled(true);

        if (chart instanceof BarLineChartBase) {

            BarLineChartBase mChart = (BarLineChartBase) chart;

            mChart.setDrawGridBackground(false);

            // enable scaling and dragging
            mChart.setDragEnabled(true);
            mChart.setScaleEnabled(true);

            // if disabled, scaling can be done on x- and y-axis separately
            mChart.setPinchZoom(false);

            YAxis leftAxis = mChart.getAxisLeft();
            leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
            leftAxis.setTypeface(mTf);
            leftAxis.setTextSize(8f);
            leftAxis.setTextColor(Color.DKGRAY);
            leftAxis.setValueFormatter(new PercentFormatter());

            XAxis xAxis = mChart.getXAxis();
            xAxis.setTypeface(mTf);
            xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
            xAxis.setTextSize(8f);
            xAxis.setTextColor(Color.DKGRAY);

            mChart.getAxisRight().setEnabled(false);
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:RealmBaseActivity.java

示例3: setup

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void setup(Chart<?> chart) {

        mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

        // no description text
        chart.setDescription("");
        chart.setNoDataTextDescription("You need to provide data for the chart.");

        // enable touch gestures
        chart.setTouchEnabled(true);

        if (chart instanceof BarLineChartBase) {

            BarLineChartBase mChart = (BarLineChartBase) chart;

            mChart.setDrawGridBackground(false);

            // enable scaling and dragging
            mChart.setDragEnabled(true);
            mChart.setScaleEnabled(true);

            // if disabled, scaling can be done on x- and y-axis separately
            mChart.setPinchZoom(false);

            YAxis leftAxis = mChart.getAxisLeft();
            leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
            leftAxis.setTypeface(mTf);
            leftAxis.setTextSize(8f);
            leftAxis.setTextColor(Color.WHITE);
//            leftAxis.setValueFormatter(new PercentFormatter());

            XAxis xAxis = mChart.getXAxis();
            xAxis.setLabelRotationAngle(-50);//设置x轴字体显示角度
            xAxis.setTypeface(mTf);
            xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
            xAxis.setTextSize(8f);
            xAxis.setTextColor(Color.WHITE);
            mChart.getAxisRight().setEnabled(false);
        }
    }
 
开发者ID:dscn,项目名称:ktball,代码行数:41,代码来源:RealmBaseActivity.java

示例4: setup

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void setup(Chart<?> chart) {

        mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

        // no description text
        chart.setDescription("");
        chart.setNoDataTextDescription("You need to provide data for the chart.");

        // enable touch gestures
        chart.setTouchEnabled(true);

        if (chart instanceof BarLineChartBase) {

            BarLineChartBase mChart = (BarLineChartBase) chart;

            mChart.setDrawGridBackground(false);

            // enable scaling and dragging
            mChart.setDragEnabled(true);
            mChart.setScaleEnabled(true);

            // if disabled, scaling can be done on x- and y-axis separately
            mChart.setPinchZoom(false);

            YAxis leftAxis = mChart.getAxisLeft();
            leftAxis.removeAllLimitLines(); // reset all limit lines to avoid overlapping lines
            leftAxis.setTypeface(mTf);
            leftAxis.setTextSize(8f);
            leftAxis.setTextColor(Color.DKGRAY);
            leftAxis.setValueFormatter(new PercentFormatter());

            XAxis xAxis = mChart.getXAxis();
            xAxis.setTypeface(mTf);
            xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
            xAxis.setTextSize(8f);
            xAxis.setTextColor(Color.DKGRAY);

            mChart.getAxisRight().setEnabled(false);
        }
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:41,代码来源:RealmBaseActivity.java

示例5: createChart

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
private static void createChart(Chart barChart, List<Pair<String, Integer>> chartData, String title, Context context){

        int count = chartData.size() > 10 ? 10 : chartData.size();

        String[] stateNames = new String[count];
        for (int i=0; i<count; ++i) {
            Pair<String, Integer> record = chartData.get(i);
            stateNames[i] = record.first;
        }

        StateAxisValueFormatter stateAxisValueFormatter = new StateAxisValueFormatter(stateNames);

        barChart.getDescription().setEnabled(false);
        barChart.setTouchEnabled(false);

        XAxis xl = barChart.getXAxis();
        xl.setPosition(XAxis.XAxisPosition.BOTTOM);
        xl.setDrawAxisLine(true);
        xl.setDrawGridLines(true);
        xl.setGridLineWidth(0.3f);
        xl.setTextSize(11f);
        xl.setTextColor(Color.BLACK);
        xl.setLabelCount(count);
        xl.setValueFormatter(stateAxisValueFormatter);

        // setting data
        Legend l = barChart.getLegend();
        l.setDirection(Legend.LegendDirection.LEFT_TO_RIGHT);
        l.setFormSize(11f);
        l.setTextSize(11f);
        l.setXEntrySpace(4f);

        setData(barChart, chartData, title,context);
    }
 
开发者ID:fga-gpp-mds,项目名称:2016.2-CidadeDemocratica,代码行数:35,代码来源:CharterGenerator.java

示例6: configureChartDefaults

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
protected void configureChartDefaults(Chart<?> chart) {
    chart.setDescription("");

    // if enabled, the chart will always start at zero on the y-axis
    chart.setNoDataText(getString(R.string.chart_no_data_synchronize));

    // disable value highlighting
    chart.setHighlightPerTapEnabled(false);

    // enable touch gestures
    chart.setTouchEnabled(true);

    setupLegend(chart);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:15,代码来源:AbstractChartFragment.java

示例7: setTouchEnabled

import com.github.mikephil.charting.charts.Chart; //导入方法依赖的package包/类
@ReactProp(name = "touchEnabled")
public void setTouchEnabled(Chart chart, boolean enabled) {
    chart.setTouchEnabled(enabled);
}
 
开发者ID:mskec,项目名称:react-native-mp-android-chart,代码行数:5,代码来源:ChartBaseManager.java


注:本文中的com.github.mikephil.charting.charts.Chart.setTouchEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。