def extract_export_code(
      placeholder=random_canvas_id, export_type='png', file_name='chart'
    )
      js = ''
      js << "\n <script>"
      js << "\n (function() {"
      js << "\n \tvar onload = window.onload;"
      js << "\n \twindow.onload = function(){"
      js << "\n \t\tif (typeof onload == 'function') onload();"
      js << "\n \t\tvar chartDom = document.getElementById('#{placeholder}');"
      js << "\n \t\tvar chart = Highcharts.charts[Highcharts.attr(chartDom,"
      js << " 'data-highcharts-chart')]"
      js << "\n \t\tchart.exportChartLocal({"
      js << "\n \t\t\t" + append_chart_type(export_type)
      js << "\n \t\t\tfilename: '#{file_name}'"
      js << "\n \t\t});\n \t};\n })();"
      js << "\n </script>"
      js
    end
def extract_export_code(
      placeholder=random_canvas_id, export_type='png', file_name='chart'
    )
      js = ''
      js << "\n <script>"
      js << "\n (function() {"
      js << "\n \tvar onload = window.onload;"
      js << "\n \twindow.onload = function(){"
      js << "\n \t\tif (typeof onload == 'function') onload();"
      js << "\n \t\tvar chartDom = document.getElementById('#{placeholder}');"
      js << "\n \t\tvar chart = Highcharts.charts[Highcharts.attr(chartDom,"
      js << " 'data-highcharts-chart')]"
      js << "\n \t\tchart.exportChartLocal({"
      js << "\n \t\t\t" + append_chart_type(export_type)
      js << "\n \t\t\tfilename: '#{file_name}'"
      js << "\n \t\t});\n \t};\n })();"
      js << "\n </script>"
      js
    end
Returns the script to export the chart in different formats for
   web frameworks

 @param file_name [String] The name of the file after exporting the chart
 @param placeholder [String] The ID of the DIV element that
   the HighChart should be rendered in
 @param type [String] format to which chart has to be exported
 @return [String] the script to export the chart in web frameworks