Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1c5fc6d
replace Cyrillic diagram name with Latin
Tsenzuk Jul 6, 2021
bc3a4b9
allow to pass the chart position as a fields of chart
Tsenzuk Jul 6, 2021
8a59b39
use chart.position object to set chart position on page
Tsenzuk Jul 6, 2021
4220d14
set coordinates for the first chart
Tsenzuk Jul 9, 2021
01cdcdc
update README
Tsenzuk Jul 14, 2021
b3534ea
Merge branch 'feature/alow-set-chart-coordinates'
Tsenzuk Jul 14, 2021
00d930e
add custom point color for bar chart
Tsenzuk Jul 9, 2021
a3a82dc
add custom series color; add custom fill and line colors for point
Tsenzuk Jul 12, 2021
b10392b
fix me.charts mixing (used as list of charts and list of types)
Tsenzuk Jul 12, 2021
ce6a01c
add custom markers color
Tsenzuk Jul 14, 2021
d67ba95
Add custom charts in multi-chart config
Tsenzuk Jul 14, 2021
d2e49bc
add custom legend position ('b', 'r', etc); null to hide legend
Tsenzuk Jul 14, 2021
654ee4d
Update README.md
Tsenzuk Jul 14, 2021
aa39545
Merge branch 'feature/allow-set-custom-point-color'
Tsenzuk Jul 21, 2021
94ad338
add ability to move and resize chart and title over the chart canvas
Tsenzuk Jul 14, 2021
e96f071
update README.md
Tsenzuk Jul 14, 2021
32bfa24
Merge branch 'feature/custom-layouts-position'
Tsenzuk Jul 21, 2021
00bf5ca
fix adding Line chart for multi-chart config
Tsenzuk Jul 15, 2021
465d347
Merge branch 'bugfix/fix-line-chart-add-to-multi-chart-config'
Tsenzuk Jul 21, 2021
0cbda62
add eslint for easier code formatting
Tsenzuk Jul 21, 2021
5340a96
fix "new Buffer" warning
Tsenzuk Jul 21, 2021
b22effa
Merge branch 'feature/add-eslint-dependency'
Tsenzuk Jul 21, 2021
e88917c
Add muli-layer chart support
Tsenzuk Jul 21, 2021
d80ba18
add support multi-layer chart with several layers of the same type
Tsenzuk Jul 21, 2021
85a0906
Merge branch 'feature/add-mix-chart-support-for-muli-chart'
Tsenzuk Jul 21, 2021
2b24ec7
add grouping option to be able to create staked charts
Tsenzuk Jul 21, 2021
2044996
update README.md
Tsenzuk Jul 20, 2021
341b61d
Merge branch 'feature/add-grouping-option-for-chart'
Tsenzuk Jul 21, 2021
0eb2281
Use "bar.xlsx" as default template
Tsenzuk Jul 21, 2021
a6b6a85
Merge branch 'bugfix/fix-mix-and-chartLines-examples'
Tsenzuk Jul 21, 2021
3b92705
fix deleteEmptyCells for zero values case
Tsenzuk Jul 29, 2021
8c2e456
Merge branch 'bugfix/fix-deleteEmptyCells-option'
Tsenzuk Jul 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"commonjs": true,
"es2020": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"space-before-function-paren": ["warn", "always"],
"space-before-blocks": ["warn", "always"],
"func-call-spacing": ["warn", "always"],
"object-curly-spacing": ["warn", "never"],
"quotes": ["warn", "double"],
"indent": ["warn", "tab"]
}
}
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,91 @@ xlsxChart.generate (opts, function (err, data) {
});
```

## Available chart options
```js
var opts = {
file: "chart.xlsx", // exported file
type: "nodebuffer", // optional: used by JSZip library
charts: [
{
chart: "column", // pie, doughnut, line, area, bar
grouping: "clustered", // optional: stacked, standard - allow to create stacked bar or line chart
titles: [
"title1", // list of chart titles
"title2", // list of chart titles
],
fields: [
"field1", // list of chart fields
"field2",
],
data: {
// chart: "column", // could be used to create multi-layer charts with e.g. column + bar + line + area chart in the same object
// grouping: "clustered", // same as common grouping option, but only for current layer;
"title1": {
"field1": 123, // structured data
"field2": 321,
},
"title2": {
"field1": 456,
"field2": 654,
},
},
chartTitle: "Title",
position: { // optional: chart position
fromColumn: 0, // chart top left x coordinate in columns
fromColumnOffset: 0, // chart top left x coordinate in pixels
fromRow: n * 20, // chart top left y coordinate in columns
fromRowOffset: 0, // chart top left y coordinate in pixels
toColumn: 10, // chart bottom right x coordinate in columns
toColumnOffset: 0, // chart bottom right x coordinate in pixels
toRow: (n + 1) * 20, // chart bottom right y coordinate in columns
toRowOffset: 0, // chart bottom right y coordinate in pixels
},
customColors: { // optional: chart colors
points: {
"title1": {
"field1": "FF0000", // colors in the same structure as data; not all points required
"field1": {
fill: "FF0000", // separate colors for fill and border could be set
line: "FF0000",
},
},
},
series: {
"title1": "FF0000", // whole series color could be also set
"title2": {
fill: "FF0000", // separate colors for fill and border could be set
line: "FF0000",
markerColor: "FF0000", // different marker color also could be set for line chart
},
},
},
manualLayout: { // optional blocks position on the chart canvas
plotArea: { // chart position
x: 0.5, // x and y of top left corner in proportion value 0..1
y: 0.5,
w: 0.5, // width and height of block point in proportion value 0..1
h: 0.5,
},
title: {
x: 0.5, // x and y of top left corner in proportion value 0..1
y: 0.5,
},
},
firstSliceAng: 270, // optional: first slice angle for pie and doughnut chart in degrees
holeSize: 50, // optional: hole size of doughnut chart in percent
legendPos: "r", // optional: 'l', 't', 'r', 'b', null - legend position; null to hide; right is default
deleteEmptyCells: false, // optional: allow to will empty values with 0 or leave as gaps
},
],
};

xlsxChart.writeFile (opts, function (err) {
console.log ("File: ", opts.file);
});

```

## Examples

<a href="examples/column.js">column.js</a>
Expand Down
Loading