作者:小力维2010_622_531 | 来源:互联网 | 2023-02-08 21:08
IamtryingtowriteacodetoplotagraphusingaChartengineinanAndroidlayout.Iamsuccessfull
I am trying to write a code to plot a graph using aChartengine in an Android layout.I am successfully plot the graph but i am facing issue to align the Graph in the layout within a certain ViewGroup.
我正在尝试编写一个代码,在Android布局中使用aChartengine绘制图形。我已成功绘制图形但我面临的问题是在特定ViewGroup内的布局中对齐Graph。
MyCode :
MainActivity.java
public class MainActivity extends ActionBarActivity {
List xValues;
List yValues;
List yValues1;
GraphicalView view;
MultipleTemperatureChart multiple;
RelativeLayout rlt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
xValues = new ArrayList();
yValues = new ArrayList();
yValues1 = new ArrayList();
rlt = (RelativeLayout) findViewById(R.id.rlt);
multiple = new MultipleTemperatureChart(this);
int[] data = {143,144,145,137,156,146,158,139,144,143};
double[] doubTime = new double[data.length];
double[] doubNote = new double[data.length];
double[] doubZero = new double[data.length];
for(int i=0;i
activity_main.xml
So these are the codes and screenshots of my issue. I want to plot the graph within the Green RelativeLayout and also the Red View need to come below the graph layout.
这些是我的问题的代码和屏幕截图。我想在绿色RelativeLayout中绘制图形,并且红色视图需要低于图形布局。
Please suggest me some solution or technique to plot the graphs in the layout properly.
请建议我一些解决方案或技术来正确绘制布局中的图形。
1 个解决方案