PHP Classes

French accents

Recommend this page to a friend!

      baaChart  >  All threads  >  French accents  >  (Un) Subscribe thread alerts  
Subject:French accents
Summary:How to get accents into the BaaChart titles and legend...
Messages:3
Author:Titus
Date:2007-01-15 10:01:48
Update:2007-01-16 08:40:58
 

 


  1. French accents   Reply   Report abuse  
Picture of Titus Titus - 2007-01-15 10:01:48
Hello,
I am trying to use baaChart into a web site. Product works great, I wonder if there is a way to have french accent displayed in title and legends... Thanks you very much

  2. Re: French accents   Reply   Report abuse  
Picture of Barry Andrew Barry Andrew - 2007-01-15 20:40:04 - In reply to message 1 from Titus
Just put accented characters in the strings

<?php
include 'baachart.php';

$g = new baaChart (400);
$g->setTitle ("Thé et Café Sales");
$g->setXAxis('', 1);
$g->setYAxis('', 0, 10, 5, 0) ;
$g->addDataSeries('C', 0, '2,4', 'Thé');
$g->addDataSeries('C', 0, '3,8', 'Café');
$g->display();
?>

  3. Re: French accents   Reply   Report abuse  
Picture of Titus Titus - 2007-01-16 08:40:59 - In reply to message 2 from Barry Andrew
Thanks Barry,
But I already tried that. For undefined reasons I had troubles to display accents in all files (php) - even playing with charset in the meta tag. The only way I found was to use the utf8_encode() function (just 2 fields in my database requiring accent...). I might have to modify baaChart class to do the same. The code you gave me display nothing at all (cut and passed).
Here is my code and the link where the title show funny sign...

code :

<?php
//
// UNE ENTREPRISE VERSUS LES AUTRES \ LIGNE \ NB. DE DECES \ POUR LE MOIS COURANT
//
// Elaboration de la légende jours de l'axe dex x
include_once('baa_setLabX.php');
// Elaboration du titre du diagramme
include_once('baa_setTitre.php');
//
// instanciation de la classe
//
include('baaChart.php');
$mygraph = new baaChart(800);
$mygraph->setTitle('Observatoire des décès',setBaaTitre("M",date('m')));
$mygraph->setXLabels($labelX);
$mygraph->addDataSeries('L',LINE_MARK_X,$tableau,"Autres");
$mygraph->addDataSeries('L',LINE_MARK_CIRCLE,$tableau_qui,$login);
$mygraph->setBgColor(255,255,255,1); //Transparent
$mygraph->setXAxis("Jour",1);
$mygraph->setYAxis("Deces",0,10,2,0);
$mygraph->drawGraph();
?>
end of code
Link :
ge-observ.net/dgs/baa_dgs_01.php (no matter if there is no data..)
Thanks