Contents
Login Register Wishes Forum About
Language Reference » pCache functions » getHash
Help topics
Latest updates
2233d  replaceImageMapTitle
2233d  replaceImageMapValues
2233d  createFunctionSerie
2233d  setAbsicssaPosition
2233d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
getHash - Returns the hash of a pData object

This function allows you to calculate the (nearly) unique hash of a pData object. This hash can be used to match a picture with an unique ID in the cache database. Speaking with figures, you have only one chance on 2339099464253592691 tries to find two pData objects with the same ID, we can safely rely on it to identify different charts. Moreover, you can use the Marker parameter to specify which chart template you‘re using, so same data on different charts layout will get different IDs.

Calling this function
getHash($Data,$Marker="")

$Data is a pData object.
$Marker is an optional parameter allowing you to create different ID even if the pData objet is the same.


Sample script

This will display the unique ID of the given pData object.
 /* Include all the classes */ 
 include("class/pData.class.php");
 include("class/pCache.class.php");

 /* Create your dataset object */ 
 $myData = new pData(); 
 
 /* Add data in your dataset */ 
 $myData->addPoints(array(1,3,4,3,5));

 /* Create the cache object */
 $myCache = new pCache();

 /* Compute the hash linked to the chart data */
 echo $myCache->getHash($myData);
Last updated on 08/23/2010 
by Jean-Damien 
Linked resources
  There is no linked topic yet.
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 410 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.