dojodojox.charting

dojo dojox/charting/Chart2D axis title special characters


i have a dojo chart, i need to use special characters (ú, ñ, etc) in the axis' title. However, html codes do not work. Any ideas?

thanks

chart.addAxis("y", {
    // title: "ú", <- renders corrupted character
    title:"&uacute;", // <- renders "&uacute;" 
    vertical: true, 
    fixLower: "major", 
    fixUpper: "major", 
    min: 0 
 });

Solution

  • Using unicode characters should work fine. Chart doesn't do any special processing on the title text, so the characters you pass in should end up as the content of the axis title element. HTML isn't going to work because Chart prefers to use SVG for labels (it will always use SVG to render rotated labels like the y-axis title), and SVG text elements don't interpret HTML entities.

    First, verify whether the axis title element has the expected content by inspecting it with your browser's developer tools. Assuming the element has the proper content, the problem is most likely font-related. Ensure 1) that the page's charset is set to "utf-8", and 2) that the font in use supports the particular characters being used.