How to embed a php graph in a web-page - php

I am using this script which is one of the examples provided by the graph itself. When I put this on a web-page by itself, it's drawing the graph. But when I embed the code in an already existing web-page (with some content), it doesn't draw a graph.
I did the experiment using img src and its working fine.
But I just wanted to submit some parameter along with that graph in same web page.
How do I do that one without using "img src"?
Thanks in advance

but i just want to copy the total graph code in my exist php script
Better don't. It's best to just use an <img> element to embed the graph. Use GET parameters to pass values:
<img src="script.php?param1=123456&param2=124050">
Creating inline images is theoretically possible using data: URIs, but it's not fully supported by Internet Explorer yet.

You can do this by generating new CSS or by using javascript.

Related

Adding downloadlink using canvg and amcharts

I am trying to add a downloadlink to a page that uses AmCharts and CanVG.
The entire graph and img displaying part is all working correctly.
Now i need a downloadlink to provide the user with the image of the graph displayed.
i have already tried to create a HTML link element to the image, but at that moment, i get an error that says "Requested URI to long".
Also i have tried using a form, parsing the source from the image(obtained via jQuery) to a new page, and displaying it there, but also that won't work..
Anybody that can help me? every solution using html/php/jquery/javascript is perfectly fine.
As i have found out, this is not possible due to the length of the url. The best solution will be just to display the image in a div, next to the chart or underneath the chart, as a thumbnail. Trough there the user can just save it into their documents.

How to embed twitter tweets .. How to catch images from tweets URLs and display the actual images?

I was wondering what kind of method I could use to directly embed videos or pictures contained in twitter tweets directly ... For example .. below is a tweet from OBAMA
President Obama: "Right now, we have a real chance to reduce gun violence in America." http://t.co/tmCoUsPyyB #TimeToAct
The link that starts with htttp:// could be a picture .. How can I actually program it so that tweets are directly displayed with the images from the urls ? I know PHP and I used the twitter API before , but I dont know how I could easily achieve that . Any help would be appreciated
The first step would to to pull the URLs of of the block of text, there is another question that points you how to solve this: Extract URLs from text in PHP
You can then use Embedly or a service like it to pull the metadata associated with that url. Here is an example of the meta data that Embedly will return: http://embed.ly/docs/explore/oembed?url=http%3A%2F%2Ft.co%2FtmCoUsPyyB
The html attribute is what you want to render on your page.
We also have a PHP library you can use as well.
Hope that helps!

PHP Using imagegrabscreen

How could I use imagegrabscreen to get a thumbnail image and a full size image of a specific website.
I was thinking that I could have an array that I feed the wanted uri's into but I am a bit stuck on how I would set the wxh of the image I need to grab. I also think that I would need a thumbnail class and a fullimage class and call them when required.
Any better Ideas?
Keep in mind that imagaegrabscreen is Windows-only. If you have multiple displays set up, this function will only grab the primary display. Also, for this to work, your Apache service must be set to Allow service to interact with desktop otherwise you will just get a blank image.
This discussion covers the use of imagegrabscreen pretty well: Getting imagegrabscreen to work
There are a lot of other discussions about saving webpages as images, too - here are a few:
Website screenshots
Web Page Screenshots with PHP?
How can I generate a screenshot of a webpage using a server-side script?
PHP: How to capture browser window screen with php?
What is the best way to create a web page thumbnail?
Screenshot of current page using PHP
shell tool which renders web site including javascript
In any languages, Can I capture a webpage and save it image file? (no install, no activeX)

Create points on screen with PHP

What I'm trying to do is load a website on a frame and then mark points on it depending on screen coordinates obtained via a function.
Do I need PHP GD?
Loading the website on the frame is not an issue. It's how to mark points on the screen that's causing my hair to fall
Nah, what you need are absolute positioned HTML elements.
You can grab the page with PHP with curl or file_get_contents() and inject some HTML/CSS into it that creates absolutely positioned <p>s or <span>s or whatever.
Checkout this post here. It uses Mootools(a JavaScript framework), PHP, and MySQL. I think it's very similar to what you are trying to do except you want to mark points on the iframe instead of doing it on an image. The plugin can be attached to an element:
David Walsh's Mootools Heatmap

Image layers cufon jquery php saving the resulting composite?

This question is a bit open at the moment as I'm not sure the idea is even possible.
So far I've loaded an image from a url, and then used jQuery UI draggable feature to allow the user to drag html text (which has been replaced using cufon font replacement) over the top of the image.
The major step (which is what my question relates to) is being able to take the image and text layered over the top of the image, and save the result, either to the server, or potentially offer the option to save the altered image to the user's HD, or what would also be useful is to upload to facebook using the facebook API, but this is something I know is possible.
It all hangs on whether it's even possible to achieve the first step, which is to save the image and layered text as a combined image?
I wonder if there is a PHP/jQuery solution that would allow me to do this?
My suggestion would be to have an internal URL that outputs the final image using jQuery and PHP, then take a screenshot using webkit2png of that page. You should know the dimensions etc., so you'll be able to crop down the resulting screenshot to just the region you're looking for.

Categories