PiRSquared17 / jsflot

Automatically exported from code.google.com/p/jsflot
0 stars 1 forks source link

not support chinese chart #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.the chart can not output chinese character.

What is the expected output? What do you see instead?
can display chinese character

What version of the product are you using? On what operating system?
os:ubuntu 9.04
jsflot:0.3.0

Original issue reported on code.google.com by jzx....@gmail.com on 8 Aug 2009 at 2:59

GoogleCodeExporter commented 9 years ago
Hello, 

Being from Europe (Norway) I simply do not have enough experience with 
non-latin characters. I will try to 
explore my options here, but I will be unable to verify the results as I am 
unable to read chinese. 

Original comment by boem...@gmail.com on 8 Aug 2009 at 11:44

GoogleCodeExporter commented 9 years ago
hello again,
    the software you want us to develop needs a jsflot's help,and i knew it was
developed by a norwegian.however the jsflot does not support chinese, we hope 
you can
help us to find the place where can control the coding transformation,plese 
give us
your thought, and then we know how to write. we will supply the code to you.

thanks

Original comment by jzx....@gmail.com on 8 Aug 2009 at 2:48

GoogleCodeExporter commented 9 years ago
Hello, 

The JavaScript library that prints the text is called canvastext.js. 
http://code.google.com/p/jsflot/source/browse/JSFlot/trunk/src/main/resources/ME
TA-INF/canvastext.js. The 
website is here: http://jim.studt.net/canvastext/

I assume this is the place to add the text-drawings. I have no experience with 
chinese characters, but I will do 
some research to see what might be the best solution. 

Original comment by boem...@gmail.com on 8 Aug 2009 at 3:11

GoogleCodeExporter commented 9 years ago
Hello, in fact we are using an enhanced version of the canvastext.js library, 
which
contains more characters, but I can tell you that it will probably never support
chinese characters, only latin characters. I'm planning to use the text drawing
methods that are described in the HTML5 recomandation, and for the older 
browsers,
use a project I'm working on : http://code.google.com/p/canvas-text/

Original comment by fabien.menager on 8 Aug 2009 at 10:23

GoogleCodeExporter commented 9 years ago
hello again,
   thank you for your kind help, I really appreciate it. At first, I had thought
jsflot was based java+ajax..But I'm regretted to tell that I cannot do any
modifications with canvastext.js, cause it is not my stuff.  My prolem is done 
by
outputting texts around the chart, and that looks nice.

Original comment by jzx....@gmail.com on 11 Aug 2009 at 2:30

GoogleCodeExporter commented 9 years ago
Hello again, 

I will continue to investigate the options to output chinese characters via
JavaScript. I would be surprised if no real solution is available, and Fabiens
suggestion above looks promising. 

Fabien: Is Chinese support planned for Flotr in general ?

Original comment by boem...@gmail.com on 11 Aug 2009 at 5:13

GoogleCodeExporter commented 9 years ago
I'm very interested in this solution too, because my charts cant render accents.
Fabien, can you tell how to use the enhanced version of canvastext.js library? 
Maybe I 
can fix my problem with this version.
Thank you.

Original comment by yoshi...@gmail.com on 25 Aug 2009 at 5:15

GoogleCodeExporter commented 9 years ago
I added lots of accentuated characters in canvastext.js from Jim Studt, the 
complete 
list is here :

http://code.google.com/p/flotr/source/browse/trunk/flotr/flotr/prototype/lib/can
vaste
xt.js#110

My plan is to use the official text drawing methods described here : 
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-
element.html#text

If you want to contribute to Flotr, I think this would be a good idea to 
implement 
this ;)

Original comment by fabien.menager on 25 Aug 2009 at 5:30

GoogleCodeExporter commented 9 years ago
Hmmm...
now looking the canvastext.js packaged with JSFlot 0.3.5, I see the basic 
accentuated 
characters (é, ç, etc) there.

any idea why the Chart's Titles/Subtitles do not accept those characters? I 
meant: 
"Prédio" renders as "Prdio".

my skills with javascript are not so good as with Java, but if you point me the 
directions to some Canvas docs I promise you that I'll take a look and try to 
help.

Thank you. 

Original comment by yoshi...@gmail.com on 25 Aug 2009 at 5:56

GoogleCodeExporter commented 9 years ago
Ooops!
My fault! The character that I was looking for wasn't there: 'á'.
I tested with a present char and works. I will try to use your extended version 
and see 
what happens.
Thank you and sorry the 'spam'.

Original comment by yoshi...@gmail.com on 25 Aug 2009 at 6:07

GoogleCodeExporter commented 9 years ago
I will have a look at the extended canvastext. This could be implemented either 
(in JSFlot) either by replacing the 
canvastext that is there now, or via an attirbute to the jsflo:resources tag 
i.e:

<jsflot:resources extendedCanvastext="true" /> or something along those lines. 

Original comment by boem...@gmail.com on 25 Aug 2009 at 6:44

GoogleCodeExporter commented 9 years ago
Also, if the extended canvas text is fully compatible with the standard 
canvastext you can include it by putting a 
link to the extended javascript file in the header of your page, and then 
excluding canvastext from 
jsflot:resources:

<jsflot:resources excludes="canvastext" />

Original comment by boem...@gmail.com on 25 Aug 2009 at 6:46

GoogleCodeExporter commented 9 years ago
I updated the canvastext.js with the enhanced one and everything is working now.
Thank you. (now I'll investigate the legend columns problem).

Original comment by yoshi...@gmail.com on 25 Aug 2009 at 7:10

GoogleCodeExporter commented 9 years ago
Yes, it is fully compatible. 
boemane, I suggest you to upgrade to the latest Flotr, I fixed lots of bugs.

Original comment by fabien.menager on 25 Aug 2009 at 7:16

GoogleCodeExporter commented 9 years ago
@Fabien, please add the chars 'ã' and 'Ã' in your canvastext.js.
Thank you.

Original comment by yoshi...@gmail.com on 26 Aug 2009 at 3:54

GoogleCodeExporter commented 9 years ago
And voila !

Original comment by fabien.menager on 26 Aug 2009 at 4:02