I am trying to put a greek Omega into the Y Axis Title. I'm following the PHPlot reference manual and its not working for me. Here's what I'm doing:
I have a MySQL server. one of the fields is "YAxisTitle". so I use PHP to connect to the mySQL server, I find the record I want (out of 100ish). and pull the information from the fields, one of them is YAxisTitle. I use the Plot->SetYTitle ( mySQL_Result($datasource, 0, "YAxisTitle")
but I can't get the Greek Letter Omega to come out. I used the examples in the manaul for the Euro sign. HTML Unicode Euro is € and UTF-8 is \xe2\x82\xac. but instead of the symbol, I get that text.
Anyone got any suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure you are using a TrueType font, e.g. with SetDefaultTTFont() and/or SetUseTTF(True). The built-in (non TrueType) GD fonts do not support what you are trying to do.
Test with a hard-coded string, e.g. SetXTitle("Test Omega Ω")
If you did (1), (2) works, but your code still does not work, you need to see exactly what MySQL is returning for that field. It should work with either the XML decimal numeric entity, or with the UTF-8 encoding of the character.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to put a greek Omega into the Y Axis Title. I'm following the PHPlot reference manual and its not working for me. Here's what I'm doing:
I have a MySQL server. one of the fields is "YAxisTitle". so I use PHP to connect to the mySQL server, I find the record I want (out of 100ish). and pull the information from the fields, one of them is YAxisTitle. I use the Plot->SetYTitle ( mySQL_Result($datasource, 0, "YAxisTitle")
but I can't get the Greek Letter Omega to come out. I used the examples in the manaul for the Euro sign. HTML Unicode Euro is € and UTF-8 is \xe2\x82\xac. but instead of the symbol, I get that text.
Anyone got any suggestions?
Make sure you are using a TrueType font, e.g. with SetDefaultTTFont() and/or SetUseTTF(True). The built-in (non TrueType) GD fonts do not support what you are trying to do.
Test with a hard-coded string, e.g. SetXTitle("Test Omega Ω")
If you did (1), (2) works, but your code still does not work, you need to see exactly what MySQL is returning for that field. It should work with either the XML decimal numeric entity, or with the UTF-8 encoding of the character.
That worked! I had to set up a font, but it does work now. Thanks.