How to create a image pointer line graph in android?

How to create a image pointer line graph in android?

Can any one help me to create a line graph like the image in android.

-------------Problems Reply------------

Using AChartEngine you can add an image, after making slight modifications in the AchartEngine - XYMultipleSeriesRenderer class. Along with X Axis text labels, Y axis text labels, add a custom property to supply your Bitmap.

/** The X axis text labels. */
private Map<Double, String> mXTextLabels = new HashMap<Double, String>();
/** The Bitmap corresponding to event. */
public Map<Double, Bitmap> mEventBitmaps = new HashMap<Double, Bitmap>();

Then in the draw method of your required chart, you can retrieve your corresponding bitmap from seriesRenderer ..

private void drawBar(Canvas canvas, float xMin, float yMin, float xMax, float yMax, int scale,
int seriesIndex, Paint paint, double barIndex) {
SimpleSeriesRenderer renderer = mRenderer.getSeriesRendererAt(seriesIndex);
.......
.......
Bitmap eventflag = mRenderer.getEventBitmap(barIndex);
double offset = Math.round(xMax) - Math.round(xMin) - eventflag.getWidth();
canvas.drawBitmap(eventflag, Math.round(xMin) + (int) offset / 2, Math.round(yMin)
- (2*eventflag.getHeight()), paint);

You will have to get familiarized with the XYMultipleSeriesRenderer in AchartEngine before diving deep into this.

Finally, in your project class(activity/fragment) from where you are displaying the chart, you can supply bitmaps for each point in the graph like this.

public XYMultipleSeriesRenderer getBarRenderer() {

if(list == null || list.isEmpty()){
return null;
}

// Creating a XYMultipleSeriesRenderer to customize the whole chart
XYMultipleSeriesRenderer multiRenderer = new XYMultipleSeriesRenderer();

multiRenderer.setXLabels(0);
/*multiRenderer.setYLabels(0);*/
for(int i=0; i< list.size();i++){
ReportsList ma = list.get(i);
multiRenderer.addXTextLabel(i, ma.getMinutes());
multiRenderer.addBarColor(i, "#" + ma.getColor());
String eventType = ma.getEvent();
int drawableId = getEventBitMap(eventType);
if(drawableId != -1){
multiRenderer.addEventBitmap(i, BitmapFactory.decodeResource(getResources(), drawableId));

}

}

Category:java Views:2 Time:2018-08-07

Related post

  • How to create basic Image animations for tablets using "android.animation" package 2011-06-13

    I have created some applications for image and movies using android.view package. Now I want to create the same for the Android tablets. I see that I can use android.animation packages for Android 3.0, but I cannot find any documentation to apply fad

  • How can I make a tiny line graph in .net 2011-06-14

    How can I make a little line graph with .net like shown in the sites below? http://monitor.red-gate.com/ or http://bandcamp.com ( ) Thanks for your input. --------------Solutions------------- These little line graphs are called sparklines - this is t

  • how to create the image dynamically in ASP.NET? 2010-02-13

    how to create the image dynamically based on the points i get from table if point =1 my image must be displayed once, if point=2 imgae has to be display twice.... in that way --------------Solutions------------- i have found the answer get the count

  • How to create an image with transparent background 2011-12-08

    How to create an image with GDlib with a transparent background? header('content-type: image/png'); $image = imagecreatetruecolor(900, 350); imagealphablending($image, true); imagesavealpha($image, true); $text_color = imagecolorallocate($image, 0, 5

  • How do I shade in a line graph? 2012-09-05

    How do I shade in a line graph? Here is an example: http://www.emsd63.org/file/28213/view. I want to shade the bottom red (from red to yellow line), the middle yellow and the top green. Thanks in advance for the help! --------------Solutions---------

  • How to create thumbnail images with white 3px border using PHP? 2010-06-11

    How to create thumbnail images with white 3px border using PHP? --------------Solutions------------- Haven't actually tried this but I think something like this might work <?php /* * Function to create a border around an image */ function drawBord

  • How to create an image column in a SQL Server table and retreive it in ASP.NET using VB 2012-03-22

    I want to know how to create an image column in a SQL Server table and retrieve it in ASP.NET using VB.NET create table Tbl(ID int primary key,Name varchar(20),Image ....) --------------Solutions------------- You want to use the VARBINARY(MAX) to sto

  • Does anyone know how to create a second address line field in Contacts? 2012-10-08

    I am trying to import contacts and many of the addresses have a second line, I cannot figure out how to create a second address line field. Any help is appreciated. --------------Solutions------------- Sorry, that's not possible with Outlook for Mac.

  • Does Vista create a System Reserve partition and how to create system image in Windows Vista? 2013-03-04

    Original title: About Windows Vista. Is Vista Creates A (System Reserved) Partition Like Windows 7 & 8 ? And How To Create System Image For Windows Vista ? To Restore Windows From It --------------Solutions------------- Hi, Your Computer Manufact

  • How to create a restore point in system protection in Safe mode? 2013-05-25

    As topic question, How to create a restore point in system protection in Safe mode? --------------Solutions------------- hi read a tutorial at the below link for everything you need to know about system restore http://www.bleepingcomputer.com/tutoria

  • how i create iso image of window 8 2013-06-25

    I installed a downloaded copy of Windows 8 Pro but I not download window 8 iso image how i create iso image of window 8 --------------Solutions------------- See: http://techingiteasy.wordpress.com/2012/11/07/part-2-how-to-upgrade-using-the-windows-8-

  • How to create a restore point to a date before the options that gives Windows Vista 2013-12-22

    How to create a restore point to a date before the options that gives Windows Vista --------------Solutions------------- How to create a restore point to a date before the options that gives Windows Vista Sorry it can’t be done. When a system restore

  • windows 7, how to create an image using IDE and AHCI on the same windows 7. 2014-12-23

    windows 7, how to create an image using IDE and AHCI on the same windows 7. I have two laptop that use IDE in the bios and AHCI. I don't want to created two image just only one for both laptop. --------------Solutions------------- Hi, Welcome to Micr

  • How to create an xml file and write in android and put into raw folder 2010-10-08

    Can anybody tell me how to create an xml file, and write in android, and where to put the file to be accessed again? Is it possible to put it into a raw folder ? --------------Solutions------------- can anybody tell how to create a xml file and write

  • How to display an image from the internet in android? 2010-11-19

    How can I display image in an ImageView in android from a URL (from the internet)? --------------Solutions------------- You can use the method setImageDrawable ImageView iv = new ImageView; URL url = new URL(address); InputStream content = (InputStre

  • Can anybody tell me how to create our own custom text view in android? 2011-01-26

    Hi Can anybody tell me how to create our own custom text view in android? I want to set different colors for the textview font. Can anybody give an example? --------------Solutions------------- Whatever you want: public class SimpleTextView extends T

  • How to create a 3d point with 2 same way textured sides? 2010-12-17

    So I create a points cloud using no 3d engines but one baked into flash: import flash.display.Bitmap; import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(400,400,true,0x00000000); var xn:Number; var yn:Number; var zn:Number; var norm

  • how to create an anchor point 2011-03-29

    I have tried to create an anchor point using: <a href="index-xxx.html#reference-name"> and <a name="reference-name"> The problem is I have a floating margin on the top and the anchor point goes to the top of the page hiding the top of the

  • how to create an image of dynamic data in php 2009-09-18

    I have to make an image of a dynamic page i.e. the page keeps on changing in every 5 minutes. I want to make images of that very page that keeps on changing so that i can have its records saved in the form of images. How can i do that using php?? i h

  • How do I overlap image with a graph in MATLAB? 2010-08-08

    I want to write a software that reads the satellite data from a text file and plots graph for different parameters of the oceans. The idea came from Oceonographic Data View(ODV). My problem is plotting a graph on an image of the Indian ocean, where t

  • iPhone, how do I draw a simple line graph from an array of prices and dates? 2010-10-06

    I'm looking for some very simple to develop line graph library. However, all the examples seem quite complicated. I have a database with two main fields, date and value. Can anyone point me at or provide me with an example of code which will do just

  • How to create an image from a string in python 2009-11-03

    I'm currently having trouble creating an image from a binary string of data in my Python program. I receive the binary data via a socket but when I try the methods I read about on here like this: buff = StringIO.StringIO() #buffer where image is stor

  • Need example of how to create/manipulate image pixel data with iPhone SDK 2010-05-04

    Looking for a simple example or link to a tutorial. Say I have a bunch of values stored in an array. I would like to create an image and update the image data from my array. Assume the array values are intensity data and will be updating a grayscale

  • How to create iOS image buttons that scale well across multiple resolutions? 2010-06-18

    I've run into the issue of using a UIBarButtonItem with a custom color. Everything out on the 'net seems to indicate that the only way around this lack of official API support revolves around the use of images. This is all fine and dandy when develop

  • How to create an image that changes state? 2010-11-22

    What is the best way to create an HTML image that displays various states (e.g. for a button: normal, hovered, selected, disabled)? Ideally, I want to do via CSS classes (including the :hover meta-class). Also, I've seen multiple states combined into

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.143 (s). 11 q(s)