I need to make an activity that displays results from a MySQL query in a line graph. Does anyone know a tutorial for beginners or sample code I could look at to accomplish this? All of my results are going to be integers of 0-10 to keep things simple if that matters.
Thanks!
This may get you started if you want to create a line graph from scratch:
How to draw a line in android
It really depends how much of this work you want to do yourself. You could probably find an open source line graph library somewhere as well.
Related
i want to add wind data on my leaflet map as a layer
wind data like this https://danwild.github.io/leaflet-velocity/
I've been working on something similar. I found a pretty good looking
and intuitive method being used to represent vector information. Have
a look at the following examples:
http://earth.nullschool.net/
http://hint.fm/wind/
http://air.nullschool.net/
http://googlemapsmania.blogspot.com/2014/07/the-growth-of-slippy-wind-map.html
In my case, I still need to find a suitable format for the wind/ocean
data I want to plot on my Leaflet map. It's certainly not a quick fix,
but man, it looks great!
Maybe this can help you too. I hope to be able to post a working
solution soon.
This plugin takes input data in form of speed in knots (nautical miles
(1.852 km) per hour) and direction in degrees. It then generates the
wind barbs and outputs an icon. This icon can easily be added to a
Leaflet marker.
You can download it here:
https://github.com/JoranBeaufort/Leaflet.windbarb And you can see a
live example here: http://www.geonet.ch/leaflet-windbarb/
I'm currently trying the Slides Google API and I've done the quick start guide so I could understand how this works (I have to say I'm not a expert developer).
After trying different things, I have reached a problem.
I have a presentation on my Google Drive which I want to try things on.
So far I've made that the code on the quick start guide works on a server, not in command line like it's showed.
Now I want to try new things but there is a problem with something.
And the code is
$slidesService = new Google_Service_Slides($client);
$presentations = $slidesService->presentations;
$pages = $slidesService->pages;
The error is:
Undefined property: Google_Service_Slides_Resource_Presentations::$pages
What might be wrong?
Based on the generated source of the Slides PHP client, I think you want $slidesService->presentations_pages.
I am looking to plot charts using the PHP image create, what kind of algorithms are used to transform my terrible chart:
Into something better like:
and
How can I make the lines of my chart smooth and pretty like the 2 charts above?
edit: I don't want to use any library, I am trying to do this myself.
Try this best think, I use these charts all the time
http://www.highcharts.com
For "smoothing the lines", you have to refer to external sources about antialiasing (or let PHP do this part, see manual)
Then, you need to have an idea how exactly your graph should look like:
axis (scaling, labeling, ...)
grid (with differend line width for major and minor segments?)
representation of data (points, straight lines, smooth lines [getting rather hard again here])
description
And I think each point could be a quite well suited coding exercise. But without more specific questions, I can't help you better.
In PHP, I was wondering how to retrieve specific data from a google search. For example if I wanted to retrieve the price on https://www.google.com/#q=ps3&tbm=shop for the first result. I have experimented with curl and domdocs and am not going any where.
The simplest way to get the contents of a webpage in PHP is to use the file_get_contents function.
http://us2.php.net/file_get_contents
Once you have the data, you'll need to parse it. There have been plenty of great articles about how to approach this, so I'm not going to repeat them. Here's a link to a good one:
http://anchetawern.github.io/blog/2013/08/07/getting-started-with-web-scraping-in-php/
I would like to ask you if you know any concrete library that is capable of drawing graph like:
so this is variation of something I would call "doube bipartitiate graph". Vertical lines just illustrate columns and i do not mean to draw a graph that look like sequence graph - just all nodes should lay somewhere on them. This picture illustrates what I mean:
The only thing we have found so far is js.graph but it seems like it is a lot of work to make it look like it. Also, google charts does not seem appropriate. Any ideas?
check this graph may be useful
Thanks