i am using charts4j to generate charts, and placing it output in an
XML blob that gets set to a client js. When I create line charts, if I
have more than one line, the chart url does not seem to survive
escaping. Or so it seems. For instance, if I output the url, from the
chart object in java, it is valid:
http://chart.apis.google.com/chart?cht=lc&chxt=y,x,x&chs=700x200&chxr=0,0.0,6.0&chxp=0,0.0,6.0&chco=453448CC,12617BCC&chg=100.0,16.666666666666668,2,2&chm=o,000000,0,-1,3,0|o,000000,1,-1,3,0&chdl=White+Horse+%28Ka_|I+Told+You+So+%28_&chd=e:gAKrAAAAAAAAAAAAAAAAAAAAAAAAAA,AAKr1VVVVVKrKrKrVVAAVV..VVAAAA&chxl=1:|2+Feb|3+Feb|4+Feb|5+Feb|6+Feb|7+Feb|8+Feb|9+Feb|10+Feb|11+Feb|12+Feb|13+Feb|14+Feb|15+Feb|16+Feb|2:|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010

But what gets actually placed in the XML, after the Transformerfactory
escapes it, is this:

http://chart.apis.google.com/chart?cht=lc&chxt=y,x,x&chs=700x200&chxr=0,0.0,6.0&chxp=0,0.0,6.0&chco=453448CC,12617BCC&chg=100.0,16.666666666666668,2,2&chm=o,000000,0,-1,3,0|o,000000,1,-1,3,0&chdl=White+Horse+%28Ka_|I+Told+You+So+%28_&chd=e:gAKrAAAAAAAAAAAAAAAAAAAAAAAAAA,AAKr1VVVVVKrKrKrVVAAVV..VVAAAA&chxl=1:|2+Feb|3+Feb|4+Feb|5+Feb|6+Feb|7+Feb|8+Feb|9+Feb|10+Feb|11+Feb|12+Feb|13+Feb|14+Feb|15+Feb|16+Feb|2:|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010|2010

These are my transformer settings:
            TransformerFactory transfac =
TransformerFactory.newInstance();
            Transformer trans = transfac.newTransformer();
            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
"yes");
            trans.setOutputProperty(OutputKeys.INDENT, "yes");
            StringWriter sw = new StringWriter();
            StreamResult result = new StreamResult(sw);
            DOMSource source = new DOMSource(doc);
            trans.transform(source, result);
            xmlString = sw.toString();

I have tried to change the encoding and such, with no luck.

It seems odd to me that the escaped strings for single line charts is
working fine, but the escaping for multi line charts seems to
invalidate the url. Can anyone give me any tips on this?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to