Optimal chart library for my site [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I want a chart api that can work almost like google stock market chart.
That means a chart where it will go from one date to another and on it will be approximated points of some events.
Example of use:
I have a day of watching a video, each time I see something interesting I click a button. The clicks are not in interval times, but I still want to see a graph where I would see the clicks in each second but approximated (will be watching the whole day on a graph and that means a separate second won't be seen). Now if I take enough people who will click the button I will have good approximated values in some points and will see what points are interesting and what points are not.
EDIT:
My problem currently is that I have all the points where users clicked on the button, but adding them all in a chart would yield lies. For example 1 user clicked at 12:00 and one at 13:00, I will see that in the mean time suppose at 12:25 I will see that 1 person clicked. A bad solution for this is to insert more data putting 0's at every other place other than the data points. That will give me very ugly graphs as the points are in seconds and the graph should show 86400 seconds (1 day) at only around 1000 pixels wide. So I want a graph that can approximate the points I give him and put 0's at all the other points by himself.
EDIT2:
That means that most of the points will be clustered while just small portion not, and I want to show those cluster as interesting points and the non-clusters as just noise.

The best Javascript charts library I ever seen is Highcharts. It's free (for non-commercial usage), can be used as it is, or with other JS frameworks (jQuery, Mootools, Prototype).
It generates points interpolation (i.e. approximation lines between irregular points, as you said) very easily. You can see that feature in the Time data with irregular intervals demo.

+1 for google charts. Your asking for something specific which require's work on your part. Google chart event's should help you in your quest interactive charts

Related

PHP/ajax table and Google results

A couple years ago I had a client with a limited budget and a short deadline who wanted a sortable searchable table of their parts inventory online - at the time they had only an excel spreadsheet. I created a database, then I just used Script Artist (because I had it) to do the front end. It all works great and he's been happy with it, except now we'd like to make sure that Google can actually find all 17,000+ parts they have available and not just the first 25.
The page where the inventory is located is just www.thesite.com/inventory.php and the url remains the same no matter what page you're on.
I've been looking around at different options, using pushState vs html snapshots, and I'm not sure what would be the best option or if I can even do anything with the current Script Artist setup or if I should just pitch the whole thing. I'd really rather not have to start over since he still doesn't have much of a budget, so if anyone could give me any input that would be helpful. Thanks.

Performance Request PHP

I'm focused on a big problem on my web aplication that uses PHP, Ajax and MySql.
I´ve already developed a script that uses a date-range timepicker for make calendars for each store that i have on my database + the advertisement that will be shown on the place. For each advertisement it will be printed 1 more calendar and in each calendar we have an input to write how many times this advertisement will be shown on that day-input.
When the user choose a daterange on year-to-year with 31 places and 1 advertisement for each place, it will be more than 11000 lines on my foreach, which causes a browser stack, and my database will not be updated.
What can i do to perform this type of foreach script?
Thanks!
I wouldn't recommend having someone selecting 11,000 items at a time. If they were to have something go wrong and start over they would be quite unhappy. Maybe do 3 months at a time or something like that.
The other option if you have to keep it this way is to create arrays for each month maybe and once you are done with a month convert it to a json array so it is one string instead of over 900 individual elements in an array. So when you post you are posting 12 json arrays.
Without showing any code or seeing an example it is a little hard to help.

How to create fundraising status graphic with HTML5, Ajax and jQuery while incorporating an image in the background

I have been given the task of creating an HTML5 application which shows how much has been fundraised so far, and who has fundraised as well. This is one of the most difficult problems I have been given so far, but with some advice from here and pointers to help guide me I would like to have a decent crack at it.
Here is a more abstract description of the problem:
This is the graphic I would like to utilise below
The dark coloured line you see in this graphic is an old rail tunnel, pictured in an old surveying drawing. The tunnel is 2,880 feet long by 10 feet wide. The person who came to me asking for help is aiming to get people to "sponsor" 1 square foot sections at $10 per section until $288k has been funded. He is wanting the "donations" to be handled by http://dps.co.nz/. The thing he is wanting is to have the fundraising progress shown on the graphic above - ideally he is wanting the total amount raised at any time to "fill" the tunnel (rather like a thermometer does), showing the amount raised so far just above the tunnel (i.e it could say something like $10,000 raised out of $288,000 - n%). When someone hovers their cursor over the "filled" section of the tunnel, a tooltip of some kind will show who has sponsored that particular section of the tunnel. When you keep moving the mouse along the filled section, tooltips will keep appearing of who has sponsored each section, as you keep moving the cursor.
I know a database with at least 2 tables will be needed. One table would be needed to describe the people who are sponsoring the section, and the other table would be needed to describe the sections (possibly section numbers, their size, how much they cost to sponsor, if they have been sponsored or not, etc). My HTML5 knowledge is still relatively fresh so I am not sure how to go about this using HTML5, but I am thinking Ajax will be needed to pull the data from the server, showing who has sponsored particular sections (as something like tooltips) and the total amount raised (in real time, preferably). I am thinking the Ajax could be used in conjunction with jQuery for effects etc.
I have seen examples of fundraising thermometers online and they look relatively simple. The thing is, the tunnel you can see in the graphic has a slight bend in it - which makes this more difficult.
If anyone could help guide me, or show examples that would help me solve this particular problem, please let me know. If anyone also has suitable alternatives I would also be very interested.
Thanks in advance!
If editing the bend out of the image would be a suitable alternative, any decent image editor (GIMP?) would make things, as you say, simple.

Adding front-end functionality to a PHP and MySQL driven Quiz application

I recently built a quiz web application using PHP and MySQL (www.ReadySetQuiz.ME) The format looks something like this:
When did we declare Independence from the British?
1775
1777
1776
1774
The Louisiana Purchase was an aquisition from which country?
England
France
Spain
Germany
The answers are a list of radio buttons. After you answer all the questions you hit the submit button and it shows how many you got correct and a breakdown of each question: whether you chose the correct answer (if not, which was the correct answer) and a distribution of previous users' choices.
One big problem I'd like to solve with this current quiz design is people can just open another tab in their browser and Google the answer. I'd like to only show 1 problem at a time and add a time limit to encourage quick responses, and consequently, eliminate the aforementioned problem.
So, I'm looking for some input/guidance - big picture (50,000 feet). How do I make it so one question is presented at a time and users only have a few seconds to answer the question? Do I use JavaScript? Are there any new improvements in HTML5 that can help me accomplish something like this? I'm really just looking for what I need to learn next. Thanks for your time!
Question1) How do I make it so one question is presented at a time and users only have a few seconds to answer the question?
You need to use a countdown/timer to present the user for a minute of less.
Question 2) Do I use JavaScript?
Yeah you can use javascript and use jQuery to make your life easier.
Also disabling right click menu and text selection in the browser window (using js) will make it difficult for the user to just copy the keyword and paste it in a new browser and search. So if they will have to type the question/keywords it will take time.

How to list all countries and its states/provinces in php? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there any quick guide/reference to list all the countries and its states/provinces?
Like when I click US, it will list: Alabama, alaska etc
pycountry is the most complete free reference I was ever able to find:
pycountry provides the ISO databases for the standards:
639 Languages
3166 Countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts
The databases are imported from Debian's pkg-isocodes, packaged into pycountry and made accessible through a Python API.
Translation files for the various strings are included as well.
Grabbing data from Geonames would be an option. It is kept relatively up to date, and is under a CC license.
I don't have code to do it, but if you want a good (free) list of administrative districts for most of the world you can use this Wikipedia page.
In case you don't want to use sql, here is just a javascript with region country's province/state, i found it a while ago. Maybe its of good use....
http://www.sitepoint.com/forums/showthread.php?350291-Country-State-City-Dropdown-list
As Squeeks says you can use GeoNames.
I did a tool ( https://github.com/yosoyadri/GeoNames-XML-Builder ) that downloads and saves GeoNames response as a XML file based on the library at http://geonamesdotorgdotnet.codeplex.com/.
You can also download a complete file of countries and states/provinces at https://raw.github.com/yosoyadri/GeoNames-XML-Builder/master/continents-countries-statesprovinces.xml
This is as close as it gets.
http://27.org/isocountrylist/
This list is rather old, however it does offer a great deal of value for those wanting a country list, with codes and abbreviations. Also, there is a link to US States and provinces there too. This has been a good resource over the years.
With this table data, it's possible for someone to create some normalized data between countries, states, provinces, counties or whatever political jurisdictions.
I thought this would be a huge time saver for this task.

Categories