• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ScatterChart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ScatterChart类属于com.github.mikephil.charting.charts包,在下文中一共展示了ScatterChart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateScatterData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
protected ScatterData generateScatterData(int dataSets, float range, int count) {
    
    ArrayList<IScatterDataSet> sets = new ArrayList<IScatterDataSet>();
    
    ScatterChart.ScatterShape[] shapes = ScatterChart.ScatterShape.getAllDefaultShapes();
    
    for(int i = 0; i < dataSets; i++) {
       
        ArrayList<Entry> entries = new ArrayList<Entry>();
        
        for(int j = 0; j < count; j++) {        
            entries.add(new Entry(j, (float) (Math.random() * range) + range / 4));
        }
        
        ScatterDataSet ds = new ScatterDataSet(entries, getLabel(i));
        ds.setScatterShapeSize(12f);
        ds.setScatterShape(shapes[i % shapes.length]);
        ds.setColors(ColorTemplate.COLORFUL_COLORS);
        ds.setScatterShapeSize(9f);
        sets.add(ds);
    }
    
    ScatterData d = new ScatterData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:SimpleFragment.java


示例2: setData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmScatterDataSet<RealmDemoData> set = new RealmScatterDataSet<RealmDemoData>(result, "xValue", "yValue");
        set.setLabel("Realm ScatterDataSet");
        set.setScatterShapeSize(9f);
        set.setColor(ColorTemplate.rgb("#CDDC39"));
        set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);

        ArrayList<IScatterDataSet> dataSets = new ArrayList<IScatterDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        ScatterData data = new ScatterData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:RealmDatabaseActivityScatter.java


示例3: generateScatterData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
protected ScatterData generateScatterData(int dataSets, float range, int count) {
    
    ArrayList<IScatterDataSet> sets = new ArrayList<IScatterDataSet>();
    
    ScatterShape[] shapes = ScatterChart.getAllPossibleShapes();
    
    for(int i = 0; i < dataSets; i++) {
       
        ArrayList<Entry> entries = new ArrayList<Entry>();
        
        for(int j = 0; j < count; j++) {        
            entries.add(new Entry((float) (Math.random() * range) + range / 4, j));
        }
        
        ScatterDataSet ds = new ScatterDataSet(entries, getLabel(i));
        ds.setScatterShapeSize(12f);
        ds.setScatterShape(shapes[i % shapes.length]);
        ds.setColors(ColorTemplate.COLORFUL_COLORS);
        ds.setScatterShapeSize(9f);
        sets.add(ds);
    }
    
    ScatterData d = new ScatterData(ChartData.generateXVals(0, count), sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:27,代码来源:SimpleFragment.java


示例4: setData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        RealmScatterDataSet<RealmDemoData> set = new RealmScatterDataSet<RealmDemoData>(result, "value", "xIndex");
        set.setLabel("Realm ScatterDataSet");
        set.setScatterShapeSize(9f);
        set.setColor(ColorTemplate.rgb("#CDDC39"));
        set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);

        ArrayList<IScatterDataSet> dataSets = new ArrayList<IScatterDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmScatterData data = new RealmScatterData(result, "xValue", dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:22,代码来源:RealmDatabaseActivityScatter.java


示例5: onCreateView

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    logger = SimpleLogger.getInstance(getContext());
    waltDevice = WaltDevice.getInstance(getContext());

    // Inflate the layout for this fragment
    final View view = inflater.inflate(R.layout.fragment_drag_latency, container, false);
    logTextView = (TextView) view.findViewById(R.id.txt_log_drag_latency);
    startButton = view.findViewById(R.id.button_start_drag);
    restartButton = view.findViewById(R.id.button_restart_drag);
    finishButton = view.findViewById(R.id.button_finish_drag);
    touchCatcher = (TouchCatcherView) view.findViewById(R.id.tap_catcher);
    crossCountsView = (TextView) view.findViewById(R.id.txt_cross_counts);
    dragCountsView = (TextView) view.findViewById(R.id.txt_drag_counts);
    latencyChart = (ScatterChart) view.findViewById(R.id.latency_chart);
    latencyChartLayout = view.findViewById(R.id.latency_chart_layout);
    logTextView.setMovementMethod(new ScrollingMovementMethod());
    view.findViewById(R.id.button_close_chart).setOnClickListener(this);
    restartButton.setEnabled(false);
    finishButton.setEnabled(false);
    return view;
}
 
开发者ID:google,项目名称:walt,代码行数:24,代码来源:DragLatencyFragment.java


示例6: onCreateView

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    logger = SimpleLogger.getInstance(getContext());
    waltDevice = WaltDevice.getInstance(getContext());

    // Inflate the layout for this fragment
    final View view = inflater.inflate(R.layout.fragment_accelerometer, container, false);
    logTextView = (TextView) view.findViewById(R.id.txt_log);
    startButton = view.findViewById(R.id.button_start);
    latencyChart = (ScatterChart) view.findViewById(R.id.latency_chart);
    latencyChartLayout = view.findViewById(R.id.latency_chart_layout);
    logTextView.setMovementMethod(new ScrollingMovementMethod());
    view.findViewById(R.id.button_close_chart).setOnClickListener(this);
    sensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
    accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    if (accelerometer == null) {
        logger.log("ERROR! Accelerometer sensor not found");
    }
    return view;
}
 
开发者ID:google,项目名称:walt,代码行数:22,代码来源:AccelerometerFragment.java


示例7: drawLatencyChart

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private void drawLatencyChart(List<Entry> phoneEntriesShifted, List<Entry> waltEntries) {
    final ScatterDataSet dataSetWalt =
            new ScatterDataSet(waltEntries, "WALT Events");
    dataSetWalt.setColor(Color.BLUE);
    dataSetWalt.setScatterShape(ScatterChart.ScatterShape.CIRCLE);
    dataSetWalt.setScatterShapeSize(8f);

    final ScatterDataSet dataSetPhoneShifted =
            new ScatterDataSet(phoneEntriesShifted, "Phone Events Shifted");
    dataSetPhoneShifted.setColor(Color.RED);
    dataSetPhoneShifted.setScatterShapeSize(10f);
    dataSetPhoneShifted.setScatterShape(ScatterChart.ScatterShape.X);

    final ScatterData scatterData = new ScatterData(dataSetWalt, dataSetPhoneShifted);
    final Description desc = new Description();
    desc.setText("");
    desc.setTextSize(12f);
    latencyChart.setDescription(desc);
    latencyChart.setData(scatterData);
    latencyChart.invalidate();
    latencyChartLayout.setVisibility(View.VISIBLE);
}
 
开发者ID:google,项目名称:walt,代码行数:23,代码来源:AccelerometerFragment.java


示例8: getRendererForShape

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE:
                return new SquareShapeRenderer();
            case CIRCLE:
                return new CircleShapeRenderer();
            case TRIANGLE:
                return new TriangleShapeRenderer();
            case CROSS:
                return new CrossShapeRenderer();
            case X:
                return new XShapeRenderer();
            case CHEVRON_UP:
                return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN:
                return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
开发者ID:PhilJay,项目名称:MPAndroidChart-Realm,代码行数:22,代码来源:RealmScatterDataSet.java


示例9: getRendererForShape

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE: return new SquareShapeRenderer();
            case CIRCLE: return new CircleShapeRenderer();
            case TRIANGLE: return new TriangleShapeRenderer();
            case CROSS: return new CrossShapeRenderer();
            case X: return new XShapeRenderer();
            case CHEVRON_UP: return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN: return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:ScatterDataSet.java


示例10: onCreateView

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.frag_simple_scatter, container, false);
    
    mChart = (ScatterChart) v.findViewById(R.id.scatterChart1);
    mChart.getDescription().setEnabled(false);
    
    Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"OpenSans-Light.ttf");
    
    MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);
    mv.setChartView(mChart); // For bounds control
    mChart.setMarker(mv);

    mChart.setDrawGridBackground(false);
    mChart.setData(generateScatterData(6, 10000, 200));
    
    XAxis xAxis = mChart.getXAxis();
    xAxis.setEnabled(true);
    xAxis.setPosition(XAxisPosition.BOTTOM);
    
    YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.setTypeface(tf);
    
    YAxis rightAxis = mChart.getAxisRight();
    rightAxis.setTypeface(tf);
    rightAxis.setDrawGridLines(false);
    
    Legend l = mChart.getLegend();
    l.setWordWrapEnabled(true);
    l.setTypeface(tf);
    l.setFormSize(14f);
    l.setTextSize(9f);
    
    // increase the space between legend & bottom and legend & content
    l.setYOffset(13f);       
    mChart.setExtraBottomOffset(16f);
    
    return v;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:ScatterChartFrag.java


示例11: onCreate

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_scatterchart_noseekbar);

    mChart = (ScatterChart) findViewById(R.id.chart1);
    setup(mChart);

    mChart.getAxisLeft().setDrawGridLines(false);
    mChart.getXAxis().setDrawGridLines(false);
    mChart.setPinchZoom(true);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:RealmDatabaseActivityScatter.java


示例12: onCreateView

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.frag_simple_scatter, container, false);
    
    mChart = (ScatterChart) v.findViewById(R.id.scatterChart1);
    mChart.setDescription("");
    
    Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"OpenSans-Light.ttf");
    
    MyMarkerView mv = new MyMarkerView(getActivity(), R.layout.custom_marker_view);

    mChart.setMarkerView(mv);

    mChart.setDrawGridBackground(false);
    mChart.setData(generateScatterData(6, 10000, 200));
    
    XAxis xAxis = mChart.getXAxis();
    xAxis.setEnabled(true);
    xAxis.setPosition(XAxisPosition.BOTTOM);
    
    YAxis leftAxis = mChart.getAxisLeft();
    leftAxis.setTypeface(tf);
    
    YAxis rightAxis = mChart.getAxisRight();
    rightAxis.setTypeface(tf);
    rightAxis.setDrawGridLines(false);
    
    Legend l = mChart.getLegend();
    l.setWordWrapEnabled(true);
    l.setTypeface(tf);
    l.setFormSize(14f);
    l.setTextSize(9f);
    
    // increase the space between legend & bottom and legend & content
    l.setYOffset(13f);       
    mChart.setExtraBottomOffset(16f);
    
    return v;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:40,代码来源:ScatterChartFrag.java


示例13: buildScatterDataForProperty

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private ScatterData buildScatterDataForProperty(WaterProfile profile, String property){
  ScatterData data = new ScatterData();

  if (profile != null){
    // Get all the measurements for the property
    Map<Double,Double> propertyMeasurementByDepth = profile.getMeasurementsForProperty(property);
    ArrayList<Entry> entries = new ArrayList<>();
    Set<Double> depths = propertyMeasurementByDepth.keySet();
    for (Double depth : depths){
      float y = (float) Math.abs(depth);
      float x = (float) propertyMeasurementByDepth.get(depth).doubleValue();
      entries.add(new Entry(x, y));
    }
    Collections.sort(entries, new EntryXComparator());

    ScatterDataSet set = new ScatterDataSet(entries, property);
    set.setColor(Color.BLACK);
    set.setScatterShape(ScatterChart.ScatterShape.CIRCLE);
    set.setScatterShapeSize(20f);
    set.setDrawValues(false);
    data.addDataSet(set);
  }else{
    Log.e(TAG, "Profile data object is null!");
  }

  return  data;
}
 
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:28,代码来源:WaterProfilePresenter.java


示例14: generateScatterData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
/**
 * Prepare ScatterData object
 * @param averageValue
 * @param seriesName
 * @return ScatterData
 */
private ScatterData generateScatterData(float averageValue,  String seriesName){
  ScatterData d = new ScatterData();
  ArrayList<Entry> entries = new ArrayList<>();
  entries.add(new Entry(1.5f, averageValue));
  ScatterDataSet set = new ScatterDataSet(entries, seriesName);
  set.setColor(Color.parseColor("#FF4081"));
  set.setScatterShape(ScatterChart.ScatterShape.SQUARE);
  set.setScatterShapeSize(15f);
  set.setDrawValues(false);
  set.setValueTextSize(10f);
  d.addDataSet(set);
  return  d;
}
 
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:20,代码来源:SummaryChartPresenter.java


示例15: drawLatencyGraph

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private void drawLatencyGraph(double[] ft, double[] fy, double[] lt, double averageBestShift) {
    final ArrayList<Entry> touchEntries = new ArrayList<>();
    final ArrayList<Entry> laserEntries = new ArrayList<>();
    final double[] laserT = new double[lt.length];
    for (int i = 0; i < ft.length; i++) {
        touchEntries.add(new Entry((float) ft[i], (float) fy[i]));
    }
    for (int i = 0; i < lt.length; i++) {
        laserT[i] = lt[i] + averageBestShift;
    }
    final double[] laserY = Utils.interp(laserT, ft, fy);
    for (int i = 0; i < laserY.length; i++) {
        laserEntries.add(new Entry((float) laserT[i], (float) laserY[i]));
    }

    final ScatterDataSet dataSetTouch = new ScatterDataSet(touchEntries, "Touch Events");
    dataSetTouch.setScatterShape(ScatterChart.ScatterShape.CIRCLE);
    dataSetTouch.setScatterShapeSize(8f);

    final ScatterDataSet dataSetLaser = new ScatterDataSet(laserEntries,
            String.format(Locale.US, "Laser Events  Latency=%.1f ms", averageBestShift));
    dataSetLaser.setColor(Color.RED);
    dataSetLaser.setScatterShapeSize(10f);
    dataSetLaser.setScatterShape(ScatterChart.ScatterShape.X);

    final ScatterData scatterData = new ScatterData(dataSetTouch, dataSetLaser);
    final Description desc = new Description();
    desc.setText("Y-Position [pixels] vs. Time [ms]");
    desc.setTextSize(12f);
    latencyChart.setDescription(desc);
    latencyChart.setData(scatterData);
    latencyChartLayout.setVisibility(View.VISIBLE);
}
 
开发者ID:google,项目名称:walt,代码行数:34,代码来源:DragLatencyFragment.java


示例16: initShapeRenderers

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
/**
 * Init default ShapeRenderers.
 */
protected void initShapeRenderers() {
    shapeRendererList = new HashMap<>();

    shapeRendererList.put(ScatterChart.ScatterShape.SQUARE.toString(), new SquareShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.CIRCLE.toString(), new CircleShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.TRIANGLE.toString(), new TriangleShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.CROSS.toString(), new CrossShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.X.toString(), new XShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.CHEVRON_UP.toString(), new ChevronUpShapeRenderer());
    shapeRendererList.put(ScatterChart.ScatterShape.CHEVRON_DOWN.toString(), new ChevronDownShapeRenderer());
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:15,代码来源:ShapeRendererHandler.java


示例17: generateScatterData

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
/**
 * Generate scatter data scatter data.
 *
 * @param dataSets the data sets
 * @param range    the range
 * @param count    the count
 * @return the scatter data
 */
protected ScatterData generateScatterData(int dataSets, float range, int count) {

    ArrayList<IScatterDataSet> sets = new ArrayList<IScatterDataSet>();

    ScatterChart.ScatterShape[] shapes = ScatterChart.ScatterShape.getAllDefaultShapes();

    for(int i = 0; i < dataSets; i++) {

        ArrayList<Entry> entries = new ArrayList<Entry>();

        for(int j = 0; j < count; j++) {
            entries.add(new Entry(j, (float) (Math.random() * range) + range / 4));
        }

        ScatterDataSet ds = new ScatterDataSet(entries, getLabel(i));
        ds.setScatterShapeSize(12f);
        ds.setScatterShape(shapes[i % shapes.length]);
        ds.setColors(ColorTemplate.COLORFUL_COLORS);
        ds.setScatterShapeSize(9f);
        sets.add(ds);
    }

    ScatterData d = new ScatterData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:bounswe,项目名称:bounswe2016group2,代码行数:35,代码来源:userHomeFragment.java


示例18: getScatterChart

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private ScatterChart getScatterChart() {
    View view = ((ViewPagerAdapter)viewPager.getAdapter()).getItem(PAGE_SCATTER_CHART).getView();
    if(view != null) {
        return (ScatterChart) view.findViewById(R.id.autoCalibrationScatterChart);
    } else {
        return null;
    }
}
 
开发者ID:Ifsttar,项目名称:NoiseCapture,代码行数:9,代码来源:CalibrationLinearityActivity.java


示例19: initScatter

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
private void initScatter() {
    final ScatterChart scatterChart = getScatterChart();
    if(scatterChart == null) {
        return;
    }
    scatterChart.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // Show
            AlertDialog.Builder builder = new AlertDialog.Builder(CalibrationLinearityActivity.this);
            builder.setTitle(CalibrationLinearityActivity.this.getText(R.string.calibration_select_frequency));
            ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(CalibrationLinearityActivity.this,
                    R.array.calibrate_type_list_array, android.R.layout.simple_selectable_list_item);
            builder.setAdapter(adapter,
                    new ItemActionOnClickListener(CalibrationLinearityActivity.this, scatterChart));
            builder.show();
        }
    });

    scatterChart.setDescription("");

    scatterChart.setDrawGridBackground(false);

    scatterChart.setMaxVisibleValueCount(200);

    Legend l = scatterChart.getLegend();
    l.setPosition(Legend.LegendPosition.RIGHT_OF_CHART);
    l.setTextColor(Color.WHITE);

    YAxis yl = scatterChart.getAxisLeft();
    yl.setTextColor(Color.WHITE);
    yl.setGridColor(Color.WHITE);
    scatterChart.getAxisRight().setEnabled(false);

    XAxis xl = scatterChart.getXAxis();
    xl.setDrawGridLines(false);
    xl.setTextColor(Color.WHITE);
    xl.setGridColor(Color.WHITE);
}
 
开发者ID:Ifsttar,项目名称:NoiseCapture,代码行数:40,代码来源:CalibrationLinearityActivity.java


示例20: onCreate

import com.github.mikephil.charting.charts.ScatterChart; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_scatterchart);

    tvX = (TextView) findViewById(R.id.tvXMax);
    tvY = (TextView) findViewById(R.id.tvYMax);

    mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
    mSeekBarX.setOnSeekBarChangeListener(this);

    mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
    mSeekBarY.setOnSeekBarChangeListener(this);

    mChart = (ScatterChart) findViewById(R.id.chart1);
    mChart.getDescription().setEnabled(false);
    mChart.setOnChartValueSelectedListener(this);

    mChart.setDrawGridBackground(false);
    mChart.setTouchEnabled(true);
    mChart.setMaxHighlightDistance(50f);

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

    mChart.setMaxVisibleValueCount(200);
    mChart.setPinchZoom(true);

    mSeekBarX.setProgress(45);
    mSeekBarY.setProgress(100);

    Legend l = mChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
    l.setOrientation(Legend.LegendOrientation.VERTICAL);
    l.setDrawInside(false);
    l.setTypeface(mTfLight);
    l.setXOffset(5f);

    YAxis yl = mChart.getAxisLeft();
    yl.setTypeface(mTfLight);
    yl.setAxisMinimum(0f); // this replaces setStartAtZero(true)
    
    mChart.getAxisRight().setEnabled(false);

    XAxis xl = mChart.getXAxis();
    xl.setTypeface(mTfLight);
    xl.setDrawGridLines(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:53,代码来源:ScatterChartActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Event类代码示例发布时间:2022-05-21
下一篇:
Java LinkerContext类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap