 |
ขอความช่วยเหลือหน่อยครับ ผมทำกราฟแล้วถ้าดึงกราฟออกมาเป็นจุดทศนิยมทำอย่างไหรครับ |
|
 |
|
|
 |
 |
|
สวัสดีครับ พอดีผมลองทำตามคลิป เพื่อ ตั้งค่ากราฟ จากโจทย์ตามรูปภาพครับ

แต่พอผมทำตามคลิปจะได้แบบนี้ครับ



แต่ปัญหาคือค่าคสวามถีจะปรับรูปแบบนี้

คือจาก โค๊โตัวนี้ครับ
GraphView graphView = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<>(getdatapoint());
graphView.addSeries(series);
series.setColor(Color.GREEN);
series.setThickness(10);
series.setDrawBackground(true);
series.setBackgroundColor(Color.argb(60,95,226,156));
series.setDrawDataPoints(true);
series.setDataPointsRadius(15);
}
private DataPoint[] getdatapoint() {
DataPoint[] dp=new DataPoint[]{
new DataPoint(0,1),
new DataPoint(2,4),
new DataPoint(3,1),
new DataPoint(5,6),
new DataPoint(8,3),

ผมต้องปรับยังไหงครับ ขอความช่วยเหลือทีน่ะครับ
Tag : Mobile, Android
|
|
 |
 |
 |
 |
Date :
2018-03-07 09:56:17 |
By :
685799958284179 |
View :
1239 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
private DataPoint[] getdatapoint() {
DataPoint[] dp=new DataPoint[]{
new DataPoint(0,1),
new DataPoint(2,4),
new DataPoint(3,1),
new DataPoint(5,6),
new DataPoint(8,3),
new DataPoint(9,5),
new DataPoint(10,8),
new DataPoint(11,4),
ถ้าจะให้ดีลูปตามโค๊ดตัวอย่างดีกว่าครับ
|
 |
 |
 |
 |
Date :
2018-03-07 13:22:11 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|