export.config.default.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /**
  2. * This is a sample chart export config file. It is provided as a reference on
  3. * how miscelaneous items in export menu can be used and set up.
  4. *
  5. * You do not need to use this file. It contains default export menu options
  6. * that will be shown if you do not provide any "menu" in your export config.
  7. *
  8. * Please refer to README.md for more information.
  9. */
  10. /**
  11. * PDF-specfic configuration
  12. */
  13. AmCharts.exportPDF = {
  14. "format": "PDF",
  15. "content": [ "Saved from:", window.location.href, {
  16. "image": "reference",
  17. "fit": [ 523.28, 769.89 ] // fit image to A4
  18. } ]
  19. };
  20. /**
  21. * Print-specfic configuration
  22. */
  23. AmCharts.exportPrint = {
  24. "format": "PRINT",
  25. "label": "Print"
  26. };
  27. /**
  28. * Define main universal config
  29. */
  30. AmCharts.exportCFG = {
  31. "enabled": true,
  32. "libs": {
  33. "path": "../libs/"
  34. },
  35. "menu": [ {
  36. "class": "export-main",
  37. "label": "Export",
  38. "menu": [ {
  39. "label": "Download as ...",
  40. "menu": [ "PNG", "JPG", "SVG", AmCharts.exportPDF ]
  41. }, {
  42. "label": "Save data ...",
  43. "menu": [ "CSV", "XLSX", "JSON" ]
  44. }, {
  45. "label": "Annotate",
  46. "action": "draw",
  47. "menu": [ {
  48. "class": "export-drawing",
  49. "menu": [ {
  50. "label": "Color ...",
  51. "menu": [ {
  52. "class": "export-drawing-color export-drawing-color-black",
  53. "label": "Black",
  54. "click": function () {
  55. this.setup.fabric.freeDrawingBrush.color = "#000";
  56. }
  57. }, {
  58. "class": "export-drawing-color export-drawing-color-white",
  59. "label": "White",
  60. "click": function () {
  61. this.setup.fabric.freeDrawingBrush.color = "#fff";
  62. }
  63. }, {
  64. "class": "export-drawing-color export-drawing-color-red",
  65. "label": "Red",
  66. "click": function () {
  67. this.setup.fabric.freeDrawingBrush.color = "#f00";
  68. }
  69. }, {
  70. "class": "export-drawing-color export-drawing-color-green",
  71. "label": "Green",
  72. "click": function () {
  73. this.setup.fabric.freeDrawingBrush.color = "#0f0";
  74. }
  75. }, {
  76. "class": "export-drawing-color export-drawing-color-blue",
  77. "label": "Blue",
  78. "click": function () {
  79. this.setup.fabric.freeDrawingBrush.color = "#00f";
  80. }
  81. } ]
  82. }, "UNDO", "REDO", {
  83. "label": "Save as ...",
  84. "menu": [ "PNG", "JPG", "SVG", AmCharts.exportPDF ]
  85. }, AmCharts.exportPrint, "CANCEL" ]
  86. } ]
  87. }, AmCharts.exportPrint ]
  88. } ]
  89. };