2014-12-02 86 views
0

我使用Highcharts在ShinyServer內繪製圖。在Firefox上一切正常,但在Chrome瀏覽器中,導出包含重複標題;這是因爲filename contains commas具有特殊字符的海圖輸出文件名

有沒有一種方法可以正確地在highcharts或Shiny中轉義文件名?建議使用雙引號,但我只將名稱的第一部分傳遞給highcharts,而不是擴展名,所以我不能在Shiny中將整個字符串加雙引號。我可以訪問highcharts服務器,所以如果我知道在哪裏尋找,我可以修改它。

我實現了簡單的解決方案是

  1. 不把逗號的文件名或
  2. 不使用Chrome,

  1. 遲早我將不得不使用某種特殊字符和
  2. Chrome只是堅持更嚴格的安全做法,其他瀏覽器將遵循一天的套件。

回答

0

你可以用API來包裝導出函數,然後在這個部分使用escape/modify name。

Highcharts.post(options.url, { 
     filename: options.filename || 'chart', 
     type: options.type, 
     width: options.width || 0, // IE8 fails to post undefined correctly, so use 0 
     scale: options.scale || 2, 
     svg: svg 
}, options.formAttributes);