ambling icon indicating copy to clipboard operation
ambling copied to clipboard

Embedded chart_data xml issue

Open igorsokolov opened this issue 15 years ago • 1 comments

I've xml data created with Ambling::Data::Pie.new(pie_data).to_xml. pie_data is array of Slice objects. When I add this xml as :chart_data the addVariable method replaces all double qoutes with %22, which cause wrong string. I've changed the helper to add escape = true parameter : script << add_variable(options, :chart_data, true)

and in addVariable method : stresc = escape ? options[key] : options[key].gsub('"', "%22")

so we don't do replacement when escape is true.

For me it works with my data. But I'm not sure how it will affect other parameters escaping. Could you tell me what is the best way to fix this issue ?

igorsokolov avatar Feb 11 '10 10:02 igorsokolov

Ahh, I see. I don't need to convert the double quotes when using the javascript escape function. I'll try that out and see if it still works for me. If so, I'll commit your change.

Thanks!

ahobson avatar Feb 17 '10 03:02 ahobson