Android Studio 实现绘制折线图APP

目录

一.总体设计

二.具体模块实现

三.效果展示


一.总体设计

1.寻找规律,公式化的生成坐标系。

2.将生成坐标系的关键参数设置为可自定义,从而可变的可以生成自己想要的坐标系。

3.将需要绘制的点绘制在坐标系中并生成折现图。

二.具体模块实现

1.界面设计

        定为 android:id="@+id/image" 的ImageView主要负责绘制的显示,在绘制的时候通过绑定到这个IMageView上进行显示,其余的 EditTex , Button 主要负责数据的输入和功能的选择。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:padding="10dp">
    <ImageView
        android:id="@+id/image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentLeft="true"
        >
    </ImageView>
    <Button
        android:id="@+id/x"
        android:text="x个数:"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/numberx"/>
    <EditText
        android:id="@+id/numberx"
        android:layout_width="100dp"
        android:layout_height="45dp"
        android:layout_alignParentRight="true"/>
    <Button
        android:id="@+id/y"
        android:text="y个数:"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/numberx"
        android:layout_toLeftOf="@+id/numbery"/>
    <EditText
        android:id="@+id/numbery"
        android:layout_width="100dp"
        android:layout_height="45dp"
        android:layout_alignParentRight="true"
        android:layout_below="@id/numberx"/>
    <Button
        android:id="@+id/maxofy"
        android:text="y最大值:"
        android:la
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值