achartengine

AChartEngine方法的使用及事件汇总

扶醉桌前 提交于 2020-01-15 23:53:53
前段时间接触了 AChartEngine ,在数据显示方面感觉非常好用,然后经过一段时间的接触,对于 AChartEngine 的扩展和使用有了一些整理和总结,本着技术共享的原则,分享给大家。我整理的东西都是来源于网络,自己精心整理,所以非喜勿喷。 AChartEngine描绘简单的折线图、柱形图、饼状图: http://www.eoeandroid.com/thread-188241-1-1.html 1. 修改背景色或设置背景图片 背景色设置需要设置两项:setMarginsColor(设置四边颜色)以及setBackgroundColor(设置中间背景色) 设置背景图片: http://blog.csdn.net/kmyhy/article/details/6590294 2. setAxisTitleTextSize(16);// 设置坐标轴标题文本大小 3. setChartTitleTextSize(20); // 设置图表标题文本大小 4. setLabelsTextSize(15); // 设置轴标签文本大小 5. setLegendTextSize(15); // 设置图例文本大小 6. renderer.setChartTitle( "个人收支表");//设置柱图名称 7. renderer.setXTitle( "名单" );//设置X轴名称 8.

Achartengine : remove chart before and redraw new chart

南笙酒味 提交于 2020-01-15 07:54:46
问题 i really frustased to redraw chart using achartengine library, i have remove view, but my chart just make new on top chart, i really confused... i have search any method but i can't get it.. this is my question before : achartengine : how to repaint / redraw chart how to redraw my chart everytime i slide my seekbar? this is my source code : @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); if (mChartView == null) { lnChart = (LinearLayout) findViewById

achartengine之折线图

拈花ヽ惹草 提交于 2020-01-13 13:46:18
跟饼图很相似。。。 相关类   dataset: 是一个XYMultipleSeriesDataset对象 可以理解为一个数据集       XYSeries:可以理解为一条线上的数据 也就是点   mRenderer:XYMultipleSeriesRenderer 渲染器用来控制表图的外观 是继承于 DefaultRenderer       XYSeriesRenderer:可以理解为没一条线的外观。。。跟一个XYSeries相对应    GraphicalView  mChartView = ChartFactory.getLineChartView(context, dataset, mRenderer);     什么动态改变数据的模拟我就没有做了。。。大家可以参照我饼图来添加。。。。。。。。。。。 package com.myluocan.chart; import org.achartengine.ChartFactory; import org.achartengine.GraphicalView; import org.achartengine.chart.PointStyle; import org.achartengine.model.XYMultipleSeriesDataset; import org.achartengine.model

AChartEngine, getting values of plots on click

血红的双手。 提交于 2020-01-13 10:48:10
问题 I used achartengine for coding a simple time chart. What I want to do is get the values that are already plotted by clicking on the point on the graph, is this possible? 回答1: Assuming that mChartView is your GraphicalView: mChartView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint(); double[] xy = mChartView.toRealPoint(0); if (seriesSelection == null) { Toast.makeText(GraficoMensile

How to show dates on x-axis in correct order

亡梦爱人 提交于 2020-01-06 15:42:35
问题 Actually i have contructed an TimeChart graph in my app. But while showing dates on x axis it shows problem. The code i have used while designing chart using renderer is shown below along with the screen shot. If anyone knows why this problem arises please help me to solve this out. Code: Calendar pCalendar_FirstDay = Calendar.getInstance(); int nMinDay = pCalendar_FirstDay.getActualMinimum(Calendar.DATE); Date currentDate = pCalendar_FirstDay.getTime(); renderer = new

sometimes line doesn't shows on the graph- a chartengine

时光怂恿深爱的人放手 提交于 2020-01-06 14:42:26
问题 I have developed a application using a chart engine. and am using achartengine for drawing graphs. I have drawn a graph using time chart. here dates are coming on x-axis and values on y axis. When the input dates are too long ie, if one date is jan-10 and 2nd date is apr 12 then the line between two points doesn't showing. ![enter image description here][there is another point on date jan 10 is there when we scroll we can see that but the line between point is not showing]1 this is code

Is “dragging with longclick” impossible on Android?

偶尔善良 提交于 2020-01-06 05:28:28
问题 I am working on charts. I can zoom in-out, dragging... Also I need longclick with dragging. if you need to explain, user can longClıck for see charts values, and user can dragging to left, right with longclick to see other values...Can Android sense it? I use achartengine library. I can handle it now:) but I have another problem about.. longPressDetector = new GestureDetector(getContext(), new SimpleOnGestureListener() { @Override public void onLongPress(final MotionEvent e) { int x = (int) e

Showing popup on clicking a point in graph AChartEngine

落爺英雄遲暮 提交于 2020-01-05 10:10:25
问题 I want to show a little popup containing the information of the point clicked in a graph which uses AchartEngine for drawing graphs. I am currently showing the point information in a toast but the requirement is to show it near the point in the graph. Is there any such feature in the API or any suggestions how I can accomplish this task ? Thanks in advance. 回答1: The toast sounds like a good way to display information. Toast takes the x and y co-ordinate for it's placement which is kinda neat

Android Studio: Specify location of gradle or android eclipse project

霸气de小男生 提交于 2020-01-04 13:38:05
问题 I extracted all the files from the achartengine library to the following path: C:\Users\student\Desktop\achartengine-1.2.0\ But when I select the path in adding a new module, an error pops up, stating: Specify location of Gradle or Android Eclipse Project 回答1: All I had to move to the jar files into the libs folder. 来源: https://stackoverflow.com/questions/31665404/android-studio-specify-location-of-gradle-or-android-eclipse-project

Android Studio: Specify location of gradle or android eclipse project

空扰寡人 提交于 2020-01-04 13:37:27
问题 I extracted all the files from the achartengine library to the following path: C:\Users\student\Desktop\achartengine-1.2.0\ But when I select the path in adding a new module, an error pops up, stating: Specify location of Gradle or Android Eclipse Project 回答1: All I had to move to the jar files into the libs folder. 来源: https://stackoverflow.com/questions/31665404/android-studio-specify-location-of-gradle-or-android-eclipse-project