Closed GoogleCodeExporter closed 8 years ago
PS: I would have sent this directly to the developers if I could have. It
didn't
seem like something that should go in the WIKI... so I opened an issue thinking
this
was basically the best place to put the code.
Original comment by elmartin...@gmail.com
on 30 Jan 2008 at 11:30
--eric(dot]martin{at}3jane[dot)com--
--ibrahim[dot]yilmaz{at}karmabilisim[dot]com-- //Added Turkish characters
/**
* Encodes a dataset for use in Google Charts
*/
private static function __simpleEncode( $valueArray, $maxValue )
{
$enc = split
(',','A,B,C,Ç,D,E,F,G,Ğ,H,I,İ,J,K,L,M,N,O,Ö,P,Q,R,S,Ş,T,U,Ü,V,W,X,Y,Z,a,b,
c,ç,d,e,f,g,ğ,h,ı,i
,ğ,j,k,l,m,n,o,ö,p,q,r,s,ş,t,u,ü,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9');
$data = array('s:');
foreach( $valueArray as $curr )
{
if ( isset($curr) && $curr >= 0)
{
$index = round( (count($enc)-1) * $curr /
$maxValue);
$data[] = $enc[$index];
}
else
{
$data[] = '_';
}
}
return implode('',$data);
}
Original comment by prehisto...@gmail.com
on 12 Sep 2008 at 8:26
--eric(dot]martin{at}3jane[dot)com--
--ibrahim[dot]yilmaz{at}karmabilisim[dot]net-- //Added Turkish characters
//Sorry for first submit this change for only contact information.
/**
* Encodes a dataset for use in Google Charts
*/
private static function __simpleEncode( $valueArray, $maxValue )
{
$enc = split
(',','A,B,C,Ç,D,E,F,G,Ğ,H,I,İ,J,K,L,M,N,O,Ö,P,Q,R,S,Ş,T,U,Ü,V,W,X,Y,Z,a,b,
c,ç,d,e,f,g,ğ,h,ı,i
,ğ,j,k,l,m,n,o,ö,p,q,r,s,ş,t,u,ü,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9');
$data = array('s:');
foreach( $valueArray as $curr )
{
if ( isset($curr) && $curr >= 0)
{
$index = round( (count($enc)-1) * $curr /
$maxValue);
$data[] = $enc[$index];
}
else
{
$data[] = '_';
}
}
return implode('',$data);
}
Original comment by prehisto...@gmail.com
on 12 Sep 2008 at 8:27
Fixed with the changes in rev. 14
Original comment by bardellie
on 12 May 2010 at 11:49
Original issue reported on code.google.com by
elmartin...@gmail.com
on 30 Jan 2008 at 7:58