{"_id":"@amanoooo/office-chart","_rev":"1-9e97bf3356d7cda52d8249e6a59bdb95","name":"@amanoooo/office-chart","dist-tags":{"latest":"1.0.28"},"versions":{"1.0.27":{"name":"@amanoooo/office-chart","version":"1.0.27","keywords":["office-chart","xlsx","chart","charts","multisheet","worksheet","pptx","node","office","microsoft","excel","powerpoint","create","generate"],"author":{"url":"https://github.com/amanoooo","name":"amanoooo"},"license":"MIT","_id":"@amanoooo/office-chart@1.0.27","maintainers":[{"name":"amanoooo","email":"1060996790@qq.com"}],"homepage":"https://github.com/amanoooo/office-chart#readme","bugs":{"url":"https://github.com/amanoooo/office-chart/issues"},"dist":{"shasum":"768c5fafcbc91a66a84f61010ac575c45ec55db4","tarball":"https://registry.npmjs.org/@amanoooo/office-chart/-/office-chart-1.0.27.tgz","fileCount":29,"integrity":"sha512-CECgIYRhCLukW9ilBPvprgXcAEgRfJ7BVcQyRivayRFISGisLOQsIWM8xN0TQqSTyICP2pxM082XrXLLCuZj1g==","signatures":[{"sig":"MEUCIQC+h7+QatCcit275G68ZCyTIUCc3U2IN/Q5t8DOgEoEBwIgIl7lhFlxAT7RHFC8a/L0IGQf/lm1mSHnwYsDSQyXiHg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92892},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"8e2a712e54cae53ba31e010dd5dc9c420331bc07","scripts":{"test":"jest","start":"ts-node './lib/xlsx/test/xmlTool.test.ts"},"_npmUser":{"name":"amanoooo","email":"1060996790@qq.com"},"repository":{"url":"git+https://github.com/amanoooo/office-chart.git","type":"git"},"_npmVersion":"10.2.4","description":"create office xlsx and pptx with tables and charts","directories":{},"_nodeVersion":"20.11.1","dependencies":{"fs":"^0.0.1-security","jszip":"^3.10.1","xml2js":"^0.4.23","ts-node":"^10.9.1","typescript":"^4.9.5"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.2","ts-jest":"^29.0.5","@types/jest":"^29.4.0","@types/node":"^18.13.0","@types/jszip":"^3.4.1","@types/xml2js":"^0.4.11"},"_npmOperationalInternal":{"tmp":"tmp/office-chart_1.0.27_1735028296560_0.2827256073600235","host":"s3://npm-registry-packages-npm-production"}},"1.0.28":{"name":"@amanoooo/office-chart","version":"1.0.28","description":"create office xlsx and pptx with tables and charts","main":"dist/index.js","types":"dist/index.d.ts","license":"MIT","repository":{"type":"git","url":"git+https://github.com/amanoooo/office-chart.git"},"keywords":["office-chart","xlsx","chart","charts","multisheet","worksheet","pptx","node","office","microsoft","excel","powerpoint","create","generate"],"scripts":{"test":"jest","start":"ts-node './lib/xlsx/test/xmlTool.test.ts"},"dependencies":{"jszip":"^3.10.1","xml2js":"^0.4.23","fs":"^0.0.1-security","ts-node":"^10.9.1","typescript":"^4.9.5"},"devDependencies":{"@types/jszip":"^3.4.1","@types/xml2js":"^0.4.11","@types/jest":"^29.4.0","jest":"^29.4.2","ts-jest":"^29.0.5","@types/node":"^18.13.0"},"author":{"name":"amanoooo","url":"https://github.com/amanoooo"},"_id":"@amanoooo/office-chart@1.0.28","gitHead":"9dee0b19dc33c18365fc97991830abde523ed525","bugs":{"url":"https://github.com/amanoooo/office-chart/issues"},"homepage":"https://github.com/amanoooo/office-chart#readme","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-huVh3zdHdbKflMZsrf1u1eNZi0kQMWNkUl9hNmgXd4fU9kr88YBz6T2yrVAW9aJaE/uCWZjFZCtIrdLXwboKog==","shasum":"a30240ee934f3093370b18ad23667eb446bd1449","tarball":"https://registry.npmjs.org/@amanoooo/office-chart/-/office-chart-1.0.28.tgz","fileCount":29,"unpackedSize":93043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLmzem+49sO2mhc8idpOiCsyyyHlQjS9NNd4kZWRL8fAIgMKMSxTTRQq7JHWxuGhQqpAfhd2TWLXEXL4pthLWXXGQ="}]},"_npmUser":{"name":"amanoooo","email":"1060996790@qq.com"},"directories":{},"maintainers":[{"name":"amanoooo","email":"1060996790@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/office-chart_1.0.28_1735193360613_0.7270517684556197"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-24T08:18:16.495Z","modified":"2024-12-26T06:09:20.995Z","1.0.27":"2024-12-24T08:18:16.753Z","1.0.28":"2024-12-26T06:09:20.810Z"},"bugs":{"url":"https://github.com/amanoooo/office-chart/issues"},"author":{"name":"amanoooo","url":"https://github.com/amanoooo"},"license":"MIT","homepage":"https://github.com/amanoooo/office-chart#readme","keywords":["office-chart","xlsx","chart","charts","multisheet","worksheet","pptx","node","office","microsoft","excel","powerpoint","create","generate"],"repository":{"type":"git","url":"git+https://github.com/amanoooo/office-chart.git"},"description":"create office xlsx and pptx with tables and charts","maintainers":[{"name":"amanoooo","email":"1060996790@qq.com"}],"readme":"# Create XLSX and PPTX with multi worksheets and charts\r\n\r\n#\r\n\r\nNode.js excel chart builder\r\n\r\n## Quick start\r\n\r\nInstall\r\n\r\n```bash\r\nnpm install office-chart\r\n```\r\n\r\nGenerate xlsx and write chart to file\r\n\r\n```js\r\nimport { IData } from \"office-chart\";\r\nimport { XlsxGenerator } from \"office-chart\";\r\n\r\nconst gen = new XlsxGenerator();\r\n\r\nawait gen.createWorkbook();\r\n\r\nconst sheet1 = await gen.createWorksheet(\"sheet1\");\r\n\r\nconst sheet2 = await gen.createWorksheet(\"sheetWithChart2\");\r\n\r\nconst header = [\"h\", \"b\", \"c\", \"d\"];\r\nconst row1 = [\"label1\", 2, 3, 4];\r\nconst row2 = [\"label2\", 5, 6, 7];\r\n\r\nawait sheet2.addTable([header, row1, row2]);\r\n\r\nconst opt: IData = {\r\n  title: {\r\n    name: \"testChart line\",\r\n    color: \"8ab4f8\",\r\n    size: 5000,\r\n  },\r\n  range: \"B1:D3\",\r\n  type: \"line\",\r\n  rgbColors: [\"8ab4f8\", \"ff7769\"],\r\n  labels: true, //table contains labels\r\n  marker: {\r\n    size: 4,\r\n    shape: \"square\", //marker shapes, can be circle, diamond, star\r\n  },\r\n  lineWidth: 20000,\r\n};\r\n\r\nawait sheet2.addChart(opt);\r\n\r\nconst sheet3 = await gen.createWorksheet(\"sheet3\");\r\n\r\nawait gen.generate(__dirname + \"/test\", \"file\");\r\n// you can also generate buffer\r\n```\r\n\r\n#\r\n\r\nGenerate ppt with slides and text\r\n\r\n#\r\n\r\n```js\r\nimport { PptxGenetator } from \"office-chart\";\r\nimport { IPPTChartData } from \"office-chart/dist/xlsx/models/data.model\";\r\n\r\nconst gen = new PptxGenetator();\r\n\r\nawait gen.createPresentation();\r\n\r\nconst slide = await gen.createSlide();\r\n\r\nslide.addTitle(\"this is title\", {\r\n  x: \"0\",\r\n  y: \"0\",\r\n  color: \"FF0000\",\r\n  size: 4000,\r\n});\r\n\r\nslide.addSubTitle(\"this is subtitle\");\r\n\r\nslide.addText(\"this is text\", {\r\n  color: \"FF0000\",\r\n});\r\n\r\nconst header = [\"h\", \"b\", \"c\", \"d\"];\r\nconst row1 = [\"label1\", 2, 3, 4];\r\nconst row2 = [\"label2\", 5, 6, 7];\r\n\r\nawait slide.addTable([header, row1, row2], {\r\n  x: \"1000\", // left\r\n  y: \"1000\", // top\r\n  colWidth: 1081250,\r\n  rowHeight: 1059279,\r\n});\r\n\r\nconst opt: IPPTChartData = {\r\n  title: {\r\n    name: \"testChart line\",\r\n    color: \"8ab4f8\",\r\n    size: 3000,\r\n  },\r\n  type: \"line\",\r\n  data: [header, row1, row2], // can also be:\r\n  // [\r\n  //       {\r\n  //           name: 'lab1 test', //label\r\n  //           values: [1, 2, 3, 4, 5], //yvalues\r\n  //           labels: ['h', 'b', 'c', 'd', 'e'] //xvalue\r\n  //       }, {\r\n  //           name: 'lab2 test',\r\n  //           values: [4, 5, 6, 7, 8],\r\n  //           labels: ['h', 'b', 'c', 'd', 'e']\r\n  //       }, {\r\n  //           name: 'lab3 test',\r\n  //           values: [9, 1, 2, 4, 10],\r\n  //           labels: ['h', 'b', 'c', 'd', 'e']\r\n  //       }\r\n  //   ]\r\n  rgbColors: [\"8ab4f8\", \"ff7769\"],\r\n  lineWidth: 20000,\r\n  marker: {\r\n    shape: \"circle\",\r\n    size: 4,\r\n  },\r\n  labels: true,\r\n};\r\n\r\nconst slide2 = await gen.createSlide();\r\n\r\nawait slide2.addChart(opt);\r\nawait slide2.addTitle(null); //remove title\r\nawait slide2.addSubTitle(null); //remove subtitle\r\n\r\nawait gen.generate(__dirname + \"/test2\", \"file\");\r\n```\r\n\r\n#### This is an open source project, you can contribute by going to: https://github.com/adipeleg/office-chart.\r\n#### This is a npm package you are welcome to use: https://www.npmjs.com/package/office-chart \r\n#\r\n\r\n#### currently only column, line, pie and scatter charts are supported in Xlsx.\r\n\r\n#### currently only column, line chart are supported in PPTX.\r\n\r\n#\r\n\r\n#### Enjoy and don't forget to add a star :)\r\n","readmeFilename":"README.md"}