@sswroom/sswr 1.6.14 → 1.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog +10 -0
- package/data.d.ts +1 -1
- package/data.js +1 -1
- package/exporter/GPXExporter.d.ts +12 -0
- package/exporter/GPXExporter.js +89 -0
- package/exporter/XLSXExporter.d.ts +5 -5
- package/exporter/XLSXExporter.js +398 -382
- package/leaflet.js +1 -1
- package/map.d.ts +14 -10
- package/map.js +57 -10
- package/package.json +1 -1
- package/spreadsheet.d.ts +216 -4
- package/spreadsheet.js +1073 -6
- package/web.d.ts +2 -0
- package/web.js +28 -0
package/exporter/XLSXExporter.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as data from "../data.js";
|
|
|
2
2
|
import * as math from "../math.js";
|
|
3
3
|
import * as spreadsheet from "../spreadsheet.js";
|
|
4
4
|
import * as text from "../text.js";
|
|
5
|
+
import * as unit from "../unit.js";
|
|
5
6
|
import * as zip from "../zip.js";
|
|
6
7
|
|
|
7
8
|
export class XLSXExporter
|
|
@@ -424,280 +425,278 @@ export class XLSXExporter
|
|
|
424
425
|
sbContTypes.push(s);
|
|
425
426
|
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>");
|
|
426
427
|
|
|
427
|
-
/*
|
|
428
428
|
k = 0;
|
|
429
429
|
l = sheet.getDrawingCount();
|
|
430
430
|
while (k < l)
|
|
431
431
|
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
sb
|
|
435
|
-
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n")
|
|
436
|
-
sb.push("<xdr:wsDr xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">")
|
|
432
|
+
let chart;
|
|
433
|
+
let drawing = sheet.getDrawingNoCheck(k);
|
|
434
|
+
sb = [];
|
|
435
|
+
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
|
|
436
|
+
sb.push("<xdr:wsDr xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">");
|
|
437
437
|
switch (drawing.anchorType)
|
|
438
438
|
{
|
|
439
439
|
case spreadsheet.AnchorType.Absolute:
|
|
440
|
-
sb.push("<xdr:absoluteAnchor>")
|
|
441
|
-
sb.push("<xdr:pos x=\"")
|
|
442
|
-
sb.
|
|
443
|
-
sb.push("\" y=\"")
|
|
444
|
-
sb.
|
|
445
|
-
sb.push("\"/>")
|
|
446
|
-
sb.push("<xdr:ext cx=\"")
|
|
447
|
-
sb.
|
|
448
|
-
sb.push("\" cy=\"")
|
|
449
|
-
sb.
|
|
450
|
-
sb.push("\"/>")
|
|
440
|
+
sb.push("<xdr:absoluteAnchor>");
|
|
441
|
+
sb.push("<xdr:pos x=\"");
|
|
442
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posXInch)));
|
|
443
|
+
sb.push("\" y=\"");
|
|
444
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posYInch)));
|
|
445
|
+
sb.push("\"/>");
|
|
446
|
+
sb.push("<xdr:ext cx=\"");
|
|
447
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.widthInch)));
|
|
448
|
+
sb.push("\" cy=\"");
|
|
449
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.heightInch)));
|
|
450
|
+
sb.push("\"/>");
|
|
451
451
|
break;
|
|
452
452
|
case spreadsheet.AnchorType.OneCell:
|
|
453
|
-
sb.push("<xdr:oneCellAnchor>")
|
|
454
|
-
sb.push("<xdr:from>")
|
|
455
|
-
sb.push("<xdr:col>")
|
|
456
|
-
sb.
|
|
457
|
-
sb.push("</xdr:col>")
|
|
458
|
-
sb.push("<xdr:colOff>")
|
|
459
|
-
sb.
|
|
460
|
-
sb.push("</xdr:colOff>")
|
|
461
|
-
sb.push("<xdr:row>")
|
|
462
|
-
sb.
|
|
463
|
-
sb.push("</xdr:row>")
|
|
464
|
-
sb.push("<xdr:rowOff>")
|
|
465
|
-
sb.
|
|
466
|
-
sb.push("</xdr:rowOff>")
|
|
467
|
-
sb.push("</xdr:from>")
|
|
468
|
-
sb.push("<xdr:ext cx=\"")
|
|
469
|
-
sb.
|
|
470
|
-
sb.push("\" cy=\"")
|
|
471
|
-
sb.
|
|
472
|
-
sb.push("\"/>")
|
|
453
|
+
sb.push("<xdr:oneCellAnchor>");
|
|
454
|
+
sb.push("<xdr:from>");
|
|
455
|
+
sb.push("<xdr:col>");
|
|
456
|
+
sb.push(""+(drawing.col1 + 1));
|
|
457
|
+
sb.push("</xdr:col>");
|
|
458
|
+
sb.push("<xdr:colOff>");
|
|
459
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posXInch)));
|
|
460
|
+
sb.push("</xdr:colOff>");
|
|
461
|
+
sb.push("<xdr:row>");
|
|
462
|
+
sb.push(""+(drawing.row1 + 1));
|
|
463
|
+
sb.push("</xdr:row>");
|
|
464
|
+
sb.push("<xdr:rowOff>");
|
|
465
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posYInch)));
|
|
466
|
+
sb.push("</xdr:rowOff>");
|
|
467
|
+
sb.push("</xdr:from>");
|
|
468
|
+
sb.push("<xdr:ext cx=\"");
|
|
469
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.widthInch)));
|
|
470
|
+
sb.push("\" cy=\"");
|
|
471
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.heightInch)));
|
|
472
|
+
sb.push("\"/>");
|
|
473
473
|
break;
|
|
474
474
|
case spreadsheet.AnchorType.TwoCell:
|
|
475
|
-
sb.push("<xdr:twoCellAnchor editAs=\"twoCell\">")
|
|
476
|
-
sb.push("<xdr:from>")
|
|
477
|
-
sb.push("<xdr:col>")
|
|
478
|
-
sb.
|
|
479
|
-
sb.push("</xdr:col>")
|
|
480
|
-
sb.push("<xdr:colOff>")
|
|
481
|
-
sb.
|
|
482
|
-
sb.push("</xdr:colOff>")
|
|
483
|
-
sb.push("<xdr:row>")
|
|
484
|
-
sb.
|
|
485
|
-
sb.push("</xdr:row>")
|
|
486
|
-
sb.push("<xdr:rowOff>")
|
|
487
|
-
sb.
|
|
488
|
-
sb.push("</xdr:rowOff>")
|
|
489
|
-
sb.push("</xdr:from>")
|
|
490
|
-
sb.push("<xdr:to>")
|
|
491
|
-
sb.push("<xdr:col>")
|
|
492
|
-
sb.
|
|
493
|
-
sb.push("</xdr:col>")
|
|
494
|
-
sb.push("<xdr:colOff>")
|
|
495
|
-
sb.
|
|
496
|
-
sb.push("</xdr:colOff>")
|
|
497
|
-
sb.push("<xdr:row>")
|
|
498
|
-
sb.
|
|
499
|
-
sb.push("</xdr:row>")
|
|
500
|
-
sb.push("<xdr:rowOff>")
|
|
501
|
-
sb.
|
|
502
|
-
sb.push("</xdr:rowOff>")
|
|
503
|
-
sb.push("</xdr:to>")
|
|
475
|
+
sb.push("<xdr:twoCellAnchor editAs=\"twoCell\">");
|
|
476
|
+
sb.push("<xdr:from>");
|
|
477
|
+
sb.push("<xdr:col>");
|
|
478
|
+
sb.push(""+(drawing.col1 + 1));
|
|
479
|
+
sb.push("</xdr:col>");
|
|
480
|
+
sb.push("<xdr:colOff>");
|
|
481
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posXInch)));
|
|
482
|
+
sb.push("</xdr:colOff>");
|
|
483
|
+
sb.push("<xdr:row>");
|
|
484
|
+
sb.push(""+(drawing.row1 + 1));
|
|
485
|
+
sb.push("</xdr:row>");
|
|
486
|
+
sb.push("<xdr:rowOff>");
|
|
487
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.posYInch)));
|
|
488
|
+
sb.push("</xdr:rowOff>");
|
|
489
|
+
sb.push("</xdr:from>");
|
|
490
|
+
sb.push("<xdr:to>");
|
|
491
|
+
sb.push("<xdr:col>");
|
|
492
|
+
sb.push(""+(drawing.col2 + 1));
|
|
493
|
+
sb.push("</xdr:col>");
|
|
494
|
+
sb.push("<xdr:colOff>");
|
|
495
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.widthInch)));
|
|
496
|
+
sb.push("</xdr:colOff>");
|
|
497
|
+
sb.push("<xdr:row>");
|
|
498
|
+
sb.push(""+(drawing.row2 + 1));
|
|
499
|
+
sb.push("</xdr:row>");
|
|
500
|
+
sb.push("<xdr:rowOff>");
|
|
501
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, drawing.heightInch)));
|
|
502
|
+
sb.push("</xdr:rowOff>");
|
|
503
|
+
sb.push("</xdr:to>");
|
|
504
504
|
break;
|
|
505
505
|
}
|
|
506
|
-
if (drawing.chart
|
|
506
|
+
if ((chart = drawing.chart) != null)
|
|
507
507
|
{
|
|
508
|
-
sb.push("<xdr:graphicFrame>")
|
|
509
|
-
sb.push("<xdr:nvGraphicFramePr>")
|
|
510
|
-
sb.push("<xdr:cNvPr id=\"")
|
|
511
|
-
sb.
|
|
512
|
-
sb.push("\" name=\"Diagramm")
|
|
513
|
-
sb.
|
|
514
|
-
sb.push("\"/>")
|
|
515
|
-
sb.push("<xdr:cNvGraphicFramePr/>")
|
|
516
|
-
sb.push("</xdr:nvGraphicFramePr>")
|
|
517
|
-
sb.push("<xdr:xfrm>")
|
|
518
|
-
sb.push("<a:off x=\"")
|
|
519
|
-
sb.
|
|
520
|
-
sb.push("\" y=\"")
|
|
521
|
-
sb.
|
|
522
|
-
sb.push("\"/>")
|
|
523
|
-
sb.push("<a:ext cx=\"")
|
|
524
|
-
sb.
|
|
525
|
-
sb.push("\" cy=\"")
|
|
526
|
-
sb.
|
|
527
|
-
sb.push("\"/>")
|
|
528
|
-
sb.push("</xdr:xfrm>")
|
|
529
|
-
sb.push("<a:graphic>")
|
|
530
|
-
sb.push("<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\">")
|
|
531
|
-
sb.push("<c:chart r:id=\"rId")
|
|
532
|
-
sb.
|
|
533
|
-
sb.push("\"/>")
|
|
534
|
-
sb.push("</a:graphicData>")
|
|
535
|
-
sb.push("</a:graphic>")
|
|
536
|
-
sb.push("</xdr:graphicFrame>")
|
|
508
|
+
sb.push("<xdr:graphicFrame>");
|
|
509
|
+
sb.push("<xdr:nvGraphicFramePr>");
|
|
510
|
+
sb.push("<xdr:cNvPr id=\"");
|
|
511
|
+
sb.push(""+chartCnt);
|
|
512
|
+
sb.push("\" name=\"Diagramm");
|
|
513
|
+
sb.push(""+chartCnt);
|
|
514
|
+
sb.push("\"/>");
|
|
515
|
+
sb.push("<xdr:cNvGraphicFramePr/>");
|
|
516
|
+
sb.push("</xdr:nvGraphicFramePr>");
|
|
517
|
+
sb.push("<xdr:xfrm>");
|
|
518
|
+
sb.push("<a:off x=\"");
|
|
519
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, chart.getXInch())));
|
|
520
|
+
sb.push("\" y=\"");
|
|
521
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, chart.getYInch())));
|
|
522
|
+
sb.push("\"/>");
|
|
523
|
+
sb.push("<a:ext cx=\"");
|
|
524
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, chart.getWInch())));
|
|
525
|
+
sb.push("\" cy=\"");
|
|
526
|
+
sb.push(""+ Math.round(unit.Distance.convert(unit.Distance.Unit.INCH, unit.Distance.Unit.EMU, chart.getHInch())));
|
|
527
|
+
sb.push("\"/>");
|
|
528
|
+
sb.push("</xdr:xfrm>");
|
|
529
|
+
sb.push("<a:graphic>");
|
|
530
|
+
sb.push("<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\">");
|
|
531
|
+
sb.push("<c:chart r:id=\"rId");
|
|
532
|
+
sb.push(""+(chartCnt + 1));
|
|
533
|
+
sb.push("\"/>");
|
|
534
|
+
sb.push("</a:graphicData>");
|
|
535
|
+
sb.push("</a:graphic>");
|
|
536
|
+
sb.push("</xdr:graphicFrame>");
|
|
537
537
|
}
|
|
538
538
|
else
|
|
539
539
|
{
|
|
540
540
|
///////////////////////////////////////
|
|
541
541
|
}
|
|
542
|
-
sb.push("<xdr:clientData/>")
|
|
542
|
+
sb.push("<xdr:clientData/>");
|
|
543
543
|
switch (drawing.anchorType)
|
|
544
544
|
{
|
|
545
545
|
case spreadsheet.AnchorType.Absolute:
|
|
546
|
-
sb.push("</xdr:absoluteAnchor>")
|
|
546
|
+
sb.push("</xdr:absoluteAnchor>");
|
|
547
547
|
break;
|
|
548
548
|
case spreadsheet.AnchorType.OneCell:
|
|
549
|
-
sb.push("</xdr:oneCellAnchor>")
|
|
549
|
+
sb.push("</xdr:oneCellAnchor>");
|
|
550
550
|
break;
|
|
551
551
|
case spreadsheet.AnchorType.TwoCell:
|
|
552
|
-
sb.push("</xdr:twoCellAnchor>")
|
|
552
|
+
sb.push("</xdr:twoCellAnchor>");
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
sb.push("</xdr:wsDr>")
|
|
555
|
+
sb.push("</xdr:wsDr>");
|
|
556
556
|
drawingCnt++;
|
|
557
557
|
if (!dirXlDraw)
|
|
558
558
|
{
|
|
559
559
|
dirXlDraw = true;
|
|
560
|
-
|
|
560
|
+
zipFile.addDir("xl/drawings/", ts, ts, ts, 0);
|
|
561
561
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
sbContTypes.push("<Override PartName=\"/")
|
|
565
|
-
sbContTypes.
|
|
566
|
-
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-officedocument.drawing+xml\"/>")
|
|
562
|
+
s = "xl/drawings/drawing" + drawingCnt +".xml";
|
|
563
|
+
zipFile.addFile(s, new TextEncoder().encode(sb.join("")), ts, ts, ts, 0);
|
|
564
|
+
sbContTypes.push("<Override PartName=\"/");
|
|
565
|
+
sbContTypes.push(s);
|
|
566
|
+
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-officedocument.drawing+xml\"/>");
|
|
567
567
|
|
|
568
|
-
if (drawing.chart
|
|
568
|
+
if ((chart = drawing.chart) != null)
|
|
569
569
|
{
|
|
570
|
-
sb
|
|
571
|
-
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>")
|
|
572
|
-
sb.push("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">")
|
|
573
|
-
sb.push("<Relationship Id=\"rId1\" Target=\"../charts/chart")
|
|
574
|
-
sb.
|
|
575
|
-
sb.push(".xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\"/>")
|
|
576
|
-
sb.push("</Relationships>")
|
|
570
|
+
sb = [];
|
|
571
|
+
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
|
|
572
|
+
sb.push("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
|
573
|
+
sb.push("<Relationship Id=\"rId1\" Target=\"../charts/chart");
|
|
574
|
+
sb.push(""+(chartCnt + 1));
|
|
575
|
+
sb.push(".xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\"/>");
|
|
576
|
+
sb.push("</Relationships>");
|
|
577
577
|
|
|
578
578
|
if (!dirXlDrawRel)
|
|
579
579
|
{
|
|
580
580
|
dirXlDrawRel = true;
|
|
581
|
-
|
|
581
|
+
zipFile.addDir("xl/drawings/_rels/", ts, ts, ts, 0);
|
|
582
582
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
sbContTypes.push("<Override PartName=\"/")
|
|
586
|
-
sbContTypes.
|
|
587
|
-
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>")
|
|
583
|
+
s = "xl/drawings/_rels/drawing"+ drawingCnt+".xml.rels";
|
|
584
|
+
zipFile.addFile(s, new TextEncoder().encode(sb.join("")), ts, ts, ts, 0);
|
|
585
|
+
sbContTypes.push("<Override PartName=\"/");
|
|
586
|
+
sbContTypes.push(s);
|
|
587
|
+
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>");
|
|
588
588
|
|
|
589
589
|
chartCnt++;
|
|
590
|
-
sb
|
|
591
|
-
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n")
|
|
592
|
-
sb.push("<c:chartSpace xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
|
|
593
|
-
sb.push("<c:chart>")
|
|
594
|
-
if (chart.
|
|
590
|
+
sb = [];
|
|
591
|
+
sb.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
|
|
592
|
+
sb.push("<c:chartSpace xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">");
|
|
593
|
+
sb.push("<c:chart>");
|
|
594
|
+
if ((s = chart.getTitleText()) != null)
|
|
595
595
|
{
|
|
596
|
-
|
|
597
|
-
AppendTitle(sb, s.v);
|
|
596
|
+
XLSXExporter.appendTitle(sb, s);
|
|
598
597
|
}
|
|
599
|
-
sb.push("<c:plotArea>")
|
|
600
|
-
sb.push("<c:layout/>")
|
|
601
|
-
if (chart.
|
|
598
|
+
sb.push("<c:plotArea>");
|
|
599
|
+
sb.push("<c:layout/>");
|
|
600
|
+
if (chart.getChartType() != spreadsheet.ChartType.Unknown)
|
|
602
601
|
{
|
|
603
|
-
|
|
604
|
-
switch (chart.
|
|
602
|
+
let nnaxis;
|
|
603
|
+
switch (chart.getChartType())
|
|
605
604
|
{
|
|
606
|
-
case ChartType.LineChart:
|
|
607
|
-
sb.push("<c:lineChart>")
|
|
605
|
+
case spreadsheet.ChartType.LineChart:
|
|
606
|
+
sb.push("<c:lineChart>");
|
|
608
607
|
break;
|
|
609
|
-
case ChartType.Unknown:
|
|
608
|
+
case spreadsheet.ChartType.Unknown:
|
|
610
609
|
break;
|
|
611
610
|
}
|
|
612
611
|
m = 0;
|
|
613
|
-
n = chart.
|
|
612
|
+
n = chart.getSeriesCount();
|
|
614
613
|
while (m < n)
|
|
615
614
|
{
|
|
616
|
-
|
|
615
|
+
XLSXExporter.appendSeries(sb, chart.getSeriesNoCheck(m), m);
|
|
617
616
|
m++;
|
|
618
617
|
}
|
|
619
|
-
if (chart.
|
|
618
|
+
if ((nnaxis = chart.getCategoryAxis()) != null)
|
|
620
619
|
{
|
|
621
|
-
sb.push("<c:axId val=\"")
|
|
622
|
-
sb.
|
|
623
|
-
sb.push("\"/>")
|
|
620
|
+
sb.push("<c:axId val=\"");
|
|
621
|
+
sb.push(""+chart.getAxisIndex(nnaxis));
|
|
622
|
+
sb.push("\"/>");
|
|
624
623
|
}
|
|
625
|
-
if (chart.
|
|
624
|
+
if ((nnaxis = chart.getValueAxis()) != null)
|
|
626
625
|
{
|
|
627
|
-
sb.push("<c:axId val=\"")
|
|
628
|
-
sb.
|
|
629
|
-
sb.push("\"/>")
|
|
626
|
+
sb.push("<c:axId val=\"");
|
|
627
|
+
sb.push(""+ chart.getAxisIndex(nnaxis));
|
|
628
|
+
sb.push("\"/>");
|
|
630
629
|
}
|
|
631
|
-
switch (chart.
|
|
630
|
+
switch (chart.getChartType())
|
|
632
631
|
{
|
|
633
|
-
case ChartType.LineChart:
|
|
634
|
-
sb.push("</c:lineChart>")
|
|
632
|
+
case spreadsheet.ChartType.LineChart:
|
|
633
|
+
sb.push("</c:lineChart>");
|
|
635
634
|
break;
|
|
636
|
-
case ChartType.Unknown:
|
|
635
|
+
case spreadsheet.ChartType.Unknown:
|
|
637
636
|
break;
|
|
638
637
|
}
|
|
639
638
|
}
|
|
640
639
|
m = 0;
|
|
641
|
-
n = chart.
|
|
640
|
+
n = chart.getAxisCount();
|
|
642
641
|
while (m < n)
|
|
643
642
|
{
|
|
644
|
-
|
|
643
|
+
XLSXExporter.appendAxis(sb, chart.getAxis(m), m);
|
|
645
644
|
m++;
|
|
646
645
|
}
|
|
647
|
-
|
|
648
|
-
sb.push("</c:plotArea>")
|
|
649
|
-
if (chart.
|
|
646
|
+
XLSXExporter.appendShapeProp(sb, chart.getShapeProp());
|
|
647
|
+
sb.push("</c:plotArea>");
|
|
648
|
+
if (chart.hasLegend())
|
|
650
649
|
{
|
|
651
|
-
sb.push("<c:legend>")
|
|
652
|
-
sb.push("<c:legendPos val=\"")
|
|
653
|
-
switch (chart.
|
|
650
|
+
sb.push("<c:legend>");
|
|
651
|
+
sb.push("<c:legendPos val=\"");
|
|
652
|
+
switch (chart.getLegendPos())
|
|
654
653
|
{
|
|
655
|
-
case LegendPos.Bottom:
|
|
656
|
-
sb.push("b")
|
|
654
|
+
case spreadsheet.LegendPos.Bottom:
|
|
655
|
+
sb.push("b");
|
|
657
656
|
break;
|
|
658
657
|
}
|
|
659
|
-
sb.push("\"/>")
|
|
660
|
-
sb.push("<c:overlay val=\"")
|
|
661
|
-
if (chart.
|
|
658
|
+
sb.push("\"/>");
|
|
659
|
+
sb.push("<c:overlay val=\"");
|
|
660
|
+
if (chart.isLegendOverlay())
|
|
662
661
|
{
|
|
663
|
-
sb.push("true")
|
|
662
|
+
sb.push("true");
|
|
664
663
|
}
|
|
665
664
|
else
|
|
666
665
|
{
|
|
667
|
-
sb.push("false")
|
|
666
|
+
sb.push("false");
|
|
668
667
|
}
|
|
669
|
-
sb.push("\"/>")
|
|
670
|
-
sb.push("</c:legend>")
|
|
668
|
+
sb.push("\"/>");
|
|
669
|
+
sb.push("</c:legend>");
|
|
671
670
|
}
|
|
672
|
-
sb.push("<c:plotVisOnly val=\"true\"/>")
|
|
673
|
-
switch (chart.
|
|
671
|
+
sb.push("<c:plotVisOnly val=\"true\"/>");
|
|
672
|
+
switch (chart.getDisplayBlankAs())
|
|
674
673
|
{
|
|
675
|
-
case BlankAs.Default:
|
|
674
|
+
case spreadsheet.BlankAs.Default:
|
|
676
675
|
break;
|
|
677
|
-
case BlankAs.Gap:
|
|
678
|
-
sb.push("<c:dispBlanksAs val=\"gap\"/>")
|
|
676
|
+
case spreadsheet.BlankAs.Gap:
|
|
677
|
+
sb.push("<c:dispBlanksAs val=\"gap\"/>");
|
|
679
678
|
break;
|
|
680
|
-
case BlankAs.Zero:
|
|
681
|
-
sb.push("<c:dispBlanksAs val=\"zero\"/>")
|
|
679
|
+
case spreadsheet.BlankAs.Zero:
|
|
680
|
+
sb.push("<c:dispBlanksAs val=\"zero\"/>");
|
|
682
681
|
break;
|
|
683
682
|
}
|
|
684
|
-
sb.push("</c:chart>")
|
|
683
|
+
sb.push("</c:chart>");
|
|
685
684
|
//////////////////////////////////////
|
|
686
|
-
sb.push("</c:chartSpace>")
|
|
685
|
+
sb.push("</c:chartSpace>");
|
|
687
686
|
|
|
688
687
|
if (!dirXlChart)
|
|
689
688
|
{
|
|
690
689
|
dirXlChart = true;
|
|
691
|
-
|
|
690
|
+
zipFile.addDir("xl/charts/", ts, ts, ts, 0);
|
|
692
691
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
sbContTypes.push("<Override PartName=\"/")
|
|
696
|
-
sbContTypes.
|
|
697
|
-
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>")
|
|
692
|
+
s = "xl/charts/chart" + chartCnt + ".xml";
|
|
693
|
+
zipFile.addFile(s, new TextEncoder().encode(sb.join("")), ts, ts, ts, 0);
|
|
694
|
+
sbContTypes.push("<Override PartName=\"/");
|
|
695
|
+
sbContTypes.push(s);
|
|
696
|
+
sbContTypes.push("\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>");
|
|
698
697
|
}
|
|
699
698
|
k++;
|
|
700
|
-
}
|
|
699
|
+
}
|
|
701
700
|
}
|
|
702
701
|
i++;
|
|
703
702
|
}
|
|
@@ -1130,43 +1129,49 @@ export class XLSXExporter
|
|
|
1130
1129
|
return zipFile.finalize();
|
|
1131
1130
|
}
|
|
1132
1131
|
|
|
1133
|
-
|
|
1132
|
+
/**
|
|
1133
|
+
* @param {string[]} sb
|
|
1134
|
+
* @param {spreadsheet.OfficeFill|null} fill
|
|
1135
|
+
*/
|
|
1136
|
+
static appendFill(sb, fill)
|
|
1134
1137
|
{
|
|
1138
|
+
let color;
|
|
1135
1139
|
if (fill == null)
|
|
1136
1140
|
return;
|
|
1137
|
-
switch (fill.
|
|
1141
|
+
switch (fill.getFillType())
|
|
1138
1142
|
{
|
|
1139
|
-
case FillType.SolidFill:
|
|
1140
|
-
if (fill.
|
|
1143
|
+
case spreadsheet.FillType.SolidFill:
|
|
1144
|
+
if ((color = fill.getColor()) == null)
|
|
1141
1145
|
{
|
|
1142
|
-
sb.push("<a:solidFill/>")
|
|
1146
|
+
sb.push("<a:solidFill/>");
|
|
1143
1147
|
}
|
|
1144
1148
|
else
|
|
1145
1149
|
{
|
|
1146
|
-
sb.push("<a:solidFill>")
|
|
1147
|
-
|
|
1148
|
-
if (color.GetColorType() == ColorType.Preset)
|
|
1150
|
+
sb.push("<a:solidFill>");
|
|
1151
|
+
if (color.getColorType() == spreadsheet.ColorType.Preset)
|
|
1149
1152
|
{
|
|
1150
|
-
sb.push("<a:prstClr val=\"")
|
|
1151
|
-
|
|
1152
|
-
sb.
|
|
1153
|
-
sb.push("\"/>"));
|
|
1153
|
+
sb.push("<a:prstClr val=\"");
|
|
1154
|
+
sb.push(XLSXExporter.presetColorCode(color.getPresetColor()));
|
|
1155
|
+
sb.push("\"/>");
|
|
1154
1156
|
}
|
|
1155
|
-
sb.push("</a:solidFill>")
|
|
1157
|
+
sb.push("</a:solidFill>");
|
|
1156
1158
|
}
|
|
1157
1159
|
break;
|
|
1158
1160
|
}
|
|
1159
|
-
}
|
|
1161
|
+
}
|
|
1160
1162
|
|
|
1161
|
-
|
|
1163
|
+
/**
|
|
1164
|
+
* @param {string[]} sb
|
|
1165
|
+
* @param {spreadsheet.OfficeLineStyle|null} lineStyle
|
|
1166
|
+
*/
|
|
1167
|
+
static appendLineStyle(sb, lineStyle)
|
|
1162
1168
|
{
|
|
1163
|
-
|
|
1164
|
-
if (!lineStyle.SetTo(nnlineStyle))
|
|
1169
|
+
if (lineStyle == null)
|
|
1165
1170
|
return;
|
|
1166
|
-
sb.push("<a:ln>")
|
|
1167
|
-
|
|
1168
|
-
sb.push("</a:ln>")
|
|
1169
|
-
}
|
|
1171
|
+
sb.push("<a:ln>");
|
|
1172
|
+
XLSXExporter.appendFill(sb, lineStyle.getFillStyle());
|
|
1173
|
+
sb.push("</a:ln>");
|
|
1174
|
+
}
|
|
1170
1175
|
|
|
1171
1176
|
/**
|
|
1172
1177
|
* @param {string[]} sb
|
|
@@ -1197,7 +1202,12 @@ export class XLSXExporter
|
|
|
1197
1202
|
sb.push("<c:layout/>");
|
|
1198
1203
|
sb.push("</c:title>");
|
|
1199
1204
|
}
|
|
1200
|
-
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* @param {string[]} sb
|
|
1208
|
+
* @param {spreadsheet.OfficeShapeProp | null} shapeProp
|
|
1209
|
+
*/
|
|
1210
|
+
static appendShapeProp(sb, shapeProp)
|
|
1201
1211
|
{
|
|
1202
1212
|
if (shapeProp == null)
|
|
1203
1213
|
return;
|
|
@@ -1205,266 +1215,269 @@ export class XLSXExporter
|
|
|
1205
1215
|
XLSXExporter.appendFill(sb, shapeProp.getFill());
|
|
1206
1216
|
XLSXExporter.appendLineStyle(sb, shapeProp.getLineStyle());
|
|
1207
1217
|
sb.push("</c:spPr>");
|
|
1208
|
-
}
|
|
1218
|
+
}
|
|
1209
1219
|
|
|
1210
|
-
|
|
1220
|
+
/**
|
|
1221
|
+
* @param {string[]} sb
|
|
1222
|
+
* @param {spreadsheet.OfficeChartAxis | null} axis
|
|
1223
|
+
* @param {number} index
|
|
1224
|
+
*/
|
|
1225
|
+
static appendAxis(sb, axis, index)
|
|
1211
1226
|
{
|
|
1212
|
-
|
|
1213
|
-
if (!axis.SetTo(nnaxis))
|
|
1227
|
+
if (axis == null)
|
|
1214
1228
|
return;
|
|
1215
|
-
|
|
1216
|
-
switch (
|
|
1229
|
+
let s;
|
|
1230
|
+
switch (axis.getAxisType())
|
|
1217
1231
|
{
|
|
1218
|
-
case AxisType.Category:
|
|
1219
|
-
sb.push("<c:catAx>")
|
|
1232
|
+
case spreadsheet.AxisType.Category:
|
|
1233
|
+
sb.push("<c:catAx>");
|
|
1220
1234
|
break;
|
|
1221
|
-
case AxisType.Date:
|
|
1222
|
-
sb.push("<c:dateAx>")
|
|
1235
|
+
case spreadsheet.AxisType.Date:
|
|
1236
|
+
sb.push("<c:dateAx>");
|
|
1223
1237
|
break;
|
|
1224
|
-
case AxisType.Numeric:
|
|
1225
|
-
sb.push("<c:valAx>")
|
|
1238
|
+
case spreadsheet.AxisType.Numeric:
|
|
1239
|
+
sb.push("<c:valAx>");
|
|
1226
1240
|
break;
|
|
1227
|
-
case AxisType.Series:
|
|
1228
|
-
sb.push("<c:serAx>")
|
|
1241
|
+
case spreadsheet.AxisType.Series:
|
|
1242
|
+
sb.push("<c:serAx>");
|
|
1229
1243
|
break;
|
|
1230
1244
|
}
|
|
1231
|
-
sb.push("<c:axId val=\"")
|
|
1232
|
-
sb.
|
|
1233
|
-
sb.push("\"/>")
|
|
1234
|
-
sb.push("<c:scaling>")
|
|
1235
|
-
sb.push("<c:orientation val=\"minMax\"/>")
|
|
1236
|
-
sb.push("</c:scaling>")
|
|
1237
|
-
sb.push("<c:delete val=\"false\"/>")
|
|
1238
|
-
switch (
|
|
1245
|
+
sb.push("<c:axId val=\"");
|
|
1246
|
+
sb.push(""+index);
|
|
1247
|
+
sb.push("\"/>");
|
|
1248
|
+
sb.push("<c:scaling>");
|
|
1249
|
+
sb.push("<c:orientation val=\"minMax\"/>");
|
|
1250
|
+
sb.push("</c:scaling>");
|
|
1251
|
+
sb.push("<c:delete val=\"false\"/>");
|
|
1252
|
+
switch (axis.getAxisPos())
|
|
1239
1253
|
{
|
|
1240
|
-
case AxisPosition.Left:
|
|
1241
|
-
sb.push("<c:axPos val=\"l\"/>")
|
|
1254
|
+
case spreadsheet.AxisPosition.Left:
|
|
1255
|
+
sb.push("<c:axPos val=\"l\"/>");
|
|
1242
1256
|
break;
|
|
1243
|
-
case AxisPosition.Top:
|
|
1244
|
-
sb.push("<c:axPos val=\"t\"/>")
|
|
1257
|
+
case spreadsheet.AxisPosition.Top:
|
|
1258
|
+
sb.push("<c:axPos val=\"t\"/>");
|
|
1245
1259
|
break;
|
|
1246
|
-
case AxisPosition.Right:
|
|
1247
|
-
sb.push("<c:axPos val=\"r\"/>")
|
|
1260
|
+
case spreadsheet.AxisPosition.Right:
|
|
1261
|
+
sb.push("<c:axPos val=\"r\"/>");
|
|
1248
1262
|
break;
|
|
1249
|
-
case AxisPosition.Bottom:
|
|
1250
|
-
sb.push("<c:axPos val=\"b\"/>")
|
|
1263
|
+
case spreadsheet.AxisPosition.Bottom:
|
|
1264
|
+
sb.push("<c:axPos val=\"b\"/>");
|
|
1251
1265
|
break;
|
|
1252
1266
|
}
|
|
1253
|
-
if (
|
|
1267
|
+
if (axis.getMajorGridProp())
|
|
1254
1268
|
{
|
|
1255
|
-
sb.push("<c:majorGridlines>")
|
|
1256
|
-
|
|
1257
|
-
sb.push("</c:majorGridlines>")
|
|
1269
|
+
sb.push("<c:majorGridlines>");
|
|
1270
|
+
XLSXExporter.appendShapeProp(sb, axis.getMajorGridProp());
|
|
1271
|
+
sb.push("</c:majorGridlines>");
|
|
1258
1272
|
}
|
|
1259
|
-
if (
|
|
1273
|
+
if ((s = axis.getTitle()) != null)
|
|
1260
1274
|
{
|
|
1261
|
-
|
|
1275
|
+
XLSXExporter.appendTitle(sb, s);
|
|
1262
1276
|
}
|
|
1263
|
-
sb.push("<c:majorTickMark val=\"cross\"/>")
|
|
1264
|
-
sb.push("<c:minorTickMark val=\"none\"/>")
|
|
1265
|
-
switch (
|
|
1277
|
+
sb.push("<c:majorTickMark val=\"cross\"/>");
|
|
1278
|
+
sb.push("<c:minorTickMark val=\"none\"/>");
|
|
1279
|
+
switch (axis.getTickLblPos())
|
|
1266
1280
|
{
|
|
1267
|
-
case TickLabelPosition.High:
|
|
1268
|
-
sb.push("<c:tickLblPos val=\"high\"/>")
|
|
1281
|
+
case spreadsheet.TickLabelPosition.High:
|
|
1282
|
+
sb.push("<c:tickLblPos val=\"high\"/>");
|
|
1269
1283
|
break;
|
|
1270
|
-
case TickLabelPosition.Low:
|
|
1271
|
-
sb.push("<c:tickLblPos val=\"low\"/>")
|
|
1284
|
+
case spreadsheet.TickLabelPosition.Low:
|
|
1285
|
+
sb.push("<c:tickLblPos val=\"low\"/>");
|
|
1272
1286
|
break;
|
|
1273
|
-
case TickLabelPosition.NextTo:
|
|
1274
|
-
sb.push("<c:tickLblPos val=\"nextTo\"/>")
|
|
1287
|
+
case spreadsheet.TickLabelPosition.NextTo:
|
|
1288
|
+
sb.push("<c:tickLblPos val=\"nextTo\"/>");
|
|
1275
1289
|
break;
|
|
1276
|
-
case TickLabelPosition.None:
|
|
1277
|
-
sb.push("<c:tickLblPos val=\"none\"/>")
|
|
1290
|
+
case spreadsheet.TickLabelPosition.None:
|
|
1291
|
+
sb.push("<c:tickLblPos val=\"none\"/>");
|
|
1278
1292
|
break;
|
|
1279
1293
|
}
|
|
1280
|
-
|
|
1294
|
+
XLSXExporter.appendShapeProp(sb, axis.getShapeProp());
|
|
1281
1295
|
// sb.push("<c:crossAx val=\"1\"/>");
|
|
1282
|
-
sb.push("<c:crosses val=\"autoZero\"/>")
|
|
1283
|
-
sb.push("<c:crossBetween val=\"midCat\"/>")
|
|
1284
|
-
switch (
|
|
1296
|
+
sb.push("<c:crosses val=\"autoZero\"/>");
|
|
1297
|
+
sb.push("<c:crossBetween val=\"midCat\"/>");
|
|
1298
|
+
switch (axis.getAxisType())
|
|
1285
1299
|
{
|
|
1286
|
-
case AxisType.Category:
|
|
1287
|
-
sb.push("</c:catAx>")
|
|
1300
|
+
case spreadsheet.AxisType.Category:
|
|
1301
|
+
sb.push("</c:catAx>");
|
|
1288
1302
|
break;
|
|
1289
|
-
case AxisType.Date:
|
|
1290
|
-
sb.push("</c:dateAx>")
|
|
1303
|
+
case spreadsheet.AxisType.Date:
|
|
1304
|
+
sb.push("</c:dateAx>");
|
|
1291
1305
|
break;
|
|
1292
|
-
case AxisType.Numeric:
|
|
1293
|
-
sb.push("</c:valAx>")
|
|
1306
|
+
case spreadsheet.AxisType.Numeric:
|
|
1307
|
+
sb.push("</c:valAx>");
|
|
1294
1308
|
break;
|
|
1295
|
-
case AxisType.Series:
|
|
1296
|
-
sb.push("</c:serAx>")
|
|
1309
|
+
case spreadsheet.AxisType.Series:
|
|
1310
|
+
sb.push("</c:serAx>");
|
|
1297
1311
|
break;
|
|
1298
1312
|
}
|
|
1299
|
-
}
|
|
1313
|
+
}
|
|
1300
1314
|
|
|
1301
|
-
|
|
1315
|
+
/**
|
|
1316
|
+
* @param {string[]} sb
|
|
1317
|
+
* @param {spreadsheet.OfficeChartSeries} series
|
|
1318
|
+
* @param {number} index
|
|
1319
|
+
*/
|
|
1320
|
+
static appendSeries(sb, series, index)
|
|
1302
1321
|
{
|
|
1303
|
-
|
|
1304
|
-
sb.push("<c:ser>")
|
|
1305
|
-
sb.push("<c:idx val=\"")
|
|
1306
|
-
sb.
|
|
1307
|
-
sb.push("\"/>")
|
|
1308
|
-
sb.push("<c:order val=\"")
|
|
1309
|
-
sb.
|
|
1310
|
-
sb.push("\"/>")
|
|
1311
|
-
if (series.
|
|
1322
|
+
let s;
|
|
1323
|
+
sb.push("<c:ser>");
|
|
1324
|
+
sb.push("<c:idx val=\"");
|
|
1325
|
+
sb.push(""+index);
|
|
1326
|
+
sb.push("\"/>");
|
|
1327
|
+
sb.push("<c:order val=\"");
|
|
1328
|
+
sb.push(""+index);
|
|
1329
|
+
sb.push("\"/>");
|
|
1330
|
+
if ((s = series.getTitle()) != null)
|
|
1312
1331
|
{
|
|
1313
|
-
sb.push("<c:tx>")
|
|
1314
|
-
sb.push("<c:v>")
|
|
1315
|
-
s =
|
|
1316
|
-
sb.
|
|
1317
|
-
|
|
1318
|
-
sb.push("</c:
|
|
1319
|
-
sb.push("</c:tx>"));
|
|
1332
|
+
sb.push("<c:tx>");
|
|
1333
|
+
sb.push("<c:v>");
|
|
1334
|
+
s = text.toXMLText(s);
|
|
1335
|
+
sb.push(s);
|
|
1336
|
+
sb.push("</c:v>");
|
|
1337
|
+
sb.push("</c:tx>");
|
|
1320
1338
|
}
|
|
1321
|
-
|
|
1322
|
-
sb.push("<c:marker>")
|
|
1323
|
-
switch (series.
|
|
1339
|
+
XLSXExporter.appendShapeProp(sb, series.getShapeProp());
|
|
1340
|
+
sb.push("<c:marker>");
|
|
1341
|
+
switch (series.getMarkerStyle())
|
|
1324
1342
|
{
|
|
1325
|
-
case MarkerStyle.Circle:
|
|
1326
|
-
sb.push("<c:symbol val=\"circle\"/>")
|
|
1343
|
+
case spreadsheet.MarkerStyle.Circle:
|
|
1344
|
+
sb.push("<c:symbol val=\"circle\"/>");
|
|
1327
1345
|
break;
|
|
1328
|
-
case MarkerStyle.Dash:
|
|
1329
|
-
sb.push("<c:symbol val=\"dash\"/>")
|
|
1346
|
+
case spreadsheet.MarkerStyle.Dash:
|
|
1347
|
+
sb.push("<c:symbol val=\"dash\"/>");
|
|
1330
1348
|
break;
|
|
1331
|
-
case MarkerStyle.Diamond:
|
|
1332
|
-
sb.push("<c:symbol val=\"diamond\"/>")
|
|
1349
|
+
case spreadsheet.MarkerStyle.Diamond:
|
|
1350
|
+
sb.push("<c:symbol val=\"diamond\"/>");
|
|
1333
1351
|
break;
|
|
1334
|
-
case MarkerStyle.Dot:
|
|
1335
|
-
sb.push("<c:symbol val=\"dot\"/>")
|
|
1352
|
+
case spreadsheet.MarkerStyle.Dot:
|
|
1353
|
+
sb.push("<c:symbol val=\"dot\"/>");
|
|
1336
1354
|
break;
|
|
1337
|
-
case MarkerStyle.None:
|
|
1338
|
-
sb.push("<c:symbol val=\"none\"/>")
|
|
1355
|
+
case spreadsheet.MarkerStyle.None:
|
|
1356
|
+
sb.push("<c:symbol val=\"none\"/>");
|
|
1339
1357
|
break;
|
|
1340
|
-
case MarkerStyle.Picture:
|
|
1341
|
-
sb.push("<c:symbol val=\"picture\"/>")
|
|
1358
|
+
case spreadsheet.MarkerStyle.Picture:
|
|
1359
|
+
sb.push("<c:symbol val=\"picture\"/>");
|
|
1342
1360
|
break;
|
|
1343
|
-
case MarkerStyle.Plus:
|
|
1344
|
-
sb.push("<c:symbol val=\"plus\"/>")
|
|
1361
|
+
case spreadsheet.MarkerStyle.Plus:
|
|
1362
|
+
sb.push("<c:symbol val=\"plus\"/>");
|
|
1345
1363
|
break;
|
|
1346
|
-
case MarkerStyle.Square:
|
|
1347
|
-
sb.push("<c:symbol val=\"square\"/>")
|
|
1364
|
+
case spreadsheet.MarkerStyle.Square:
|
|
1365
|
+
sb.push("<c:symbol val=\"square\"/>");
|
|
1348
1366
|
break;
|
|
1349
|
-
case MarkerStyle.Star:
|
|
1350
|
-
sb.push("<c:symbol val=\"star\"/>")
|
|
1367
|
+
case spreadsheet.MarkerStyle.Star:
|
|
1368
|
+
sb.push("<c:symbol val=\"star\"/>");
|
|
1351
1369
|
break;
|
|
1352
|
-
case MarkerStyle.Triangle:
|
|
1353
|
-
sb.push("<c:symbol val=\"triangle\"/>")
|
|
1370
|
+
case spreadsheet.MarkerStyle.Triangle:
|
|
1371
|
+
sb.push("<c:symbol val=\"triangle\"/>");
|
|
1354
1372
|
break;
|
|
1355
|
-
case MarkerStyle.X:
|
|
1356
|
-
sb.push("<c:symbol val=\"x\"/>")
|
|
1373
|
+
case spreadsheet.MarkerStyle.X:
|
|
1374
|
+
sb.push("<c:symbol val=\"x\"/>");
|
|
1357
1375
|
break;
|
|
1358
1376
|
}
|
|
1359
|
-
if (series.
|
|
1377
|
+
if (series.getMarkerSize() != 0)
|
|
1360
1378
|
{
|
|
1361
|
-
sb.push("<c:size val=\"")
|
|
1362
|
-
sb.
|
|
1363
|
-
sb.push("\"/>")
|
|
1379
|
+
sb.push("<c:size val=\"");
|
|
1380
|
+
sb.push(""+series.getMarkerSize());
|
|
1381
|
+
sb.push("\"/>");
|
|
1364
1382
|
}
|
|
1365
|
-
sb.push("</c:marker>")
|
|
1383
|
+
sb.push("</c:marker>");
|
|
1366
1384
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
sb.push("<c:
|
|
1370
|
-
sb.push("<c:
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
sb.
|
|
1375
|
-
|
|
1376
|
-
sb.push("</c:
|
|
1377
|
-
sb.push("<c:strCache/>"));
|
|
1378
|
-
sb.push("</c:strRef>"));
|
|
1379
|
-
sb.push("</c:cat>"));
|
|
1385
|
+
let catData = series.getCategoryData();
|
|
1386
|
+
sb.push("<c:cat>");
|
|
1387
|
+
sb.push("<c:strRef>");
|
|
1388
|
+
sb.push("<c:f>");
|
|
1389
|
+
s = text.toXMLText(catData.toCodeRange());
|
|
1390
|
+
sb.push(s);
|
|
1391
|
+
sb.push("</c:f>");
|
|
1392
|
+
sb.push("<c:strCache/>");
|
|
1393
|
+
sb.push("</c:strRef>");
|
|
1394
|
+
sb.push("</c:cat>");
|
|
1380
1395
|
|
|
1381
|
-
|
|
1382
|
-
sb.push("<c:val>")
|
|
1383
|
-
sb.push("<c:numRef>")
|
|
1384
|
-
sb.push("<c:f>")
|
|
1385
|
-
valData.
|
|
1386
|
-
|
|
1387
|
-
sb.
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
UOSInt firstCol = valData.GetFirstCol();
|
|
1393
|
-
UOSInt lastCol = valData.GetLastCol();
|
|
1396
|
+
let valData = series.getValueData();
|
|
1397
|
+
sb.push("<c:val>");
|
|
1398
|
+
sb.push("<c:numRef>");
|
|
1399
|
+
sb.push("<c:f>");
|
|
1400
|
+
s = text.toXMLText(valData.toCodeRange());
|
|
1401
|
+
sb.push(s);
|
|
1402
|
+
sb.push("</c:f>");
|
|
1403
|
+
let firstRow = valData.getFirstRow();
|
|
1404
|
+
let lastRow = valData.getLastRow();
|
|
1405
|
+
let firstCol = valData.getFirstCol();
|
|
1406
|
+
let lastCol = valData.getLastCol();
|
|
1394
1407
|
if (firstRow == lastRow)
|
|
1395
1408
|
{
|
|
1396
|
-
|
|
1397
|
-
sb.push("<c:numCache>")
|
|
1398
|
-
sb.push("<c:ptCount val=\"")
|
|
1399
|
-
sb.
|
|
1400
|
-
sb.push("\"/>")
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
if (sheet.
|
|
1409
|
+
let sheet = valData.getSheet();
|
|
1410
|
+
sb.push("<c:numCache>");
|
|
1411
|
+
sb.push("<c:ptCount val=\"");
|
|
1412
|
+
sb.push(""+(lastCol - firstCol + 1));
|
|
1413
|
+
sb.push("\"/>");
|
|
1414
|
+
let row;
|
|
1415
|
+
let cell;
|
|
1416
|
+
let cellValue;
|
|
1417
|
+
let i;
|
|
1418
|
+
if ((row = sheet.getItem(firstRow)) != null)
|
|
1406
1419
|
{
|
|
1407
1420
|
i = firstCol;
|
|
1408
1421
|
while (i <= lastCol)
|
|
1409
1422
|
{
|
|
1410
|
-
if (row.cells
|
|
1423
|
+
if ((cell = row.cells[i]) != null && (cellValue = cell.cellValue) != null && (cell.cdt == spreadsheet.CellDataType.DateTime || cell.cdt == spreadsheet.CellDataType.Number))
|
|
1411
1424
|
{
|
|
1412
|
-
sb.push("<c:pt idx=\"")
|
|
1413
|
-
sb.
|
|
1414
|
-
sb.push("\"><c:v>")
|
|
1415
|
-
sb.
|
|
1416
|
-
sb.push("</c:v></c:pt>")
|
|
1425
|
+
sb.push("<c:pt idx=\"");
|
|
1426
|
+
sb.push(""+(i - firstCol));
|
|
1427
|
+
sb.push("\"><c:v>");
|
|
1428
|
+
sb.push(cellValue);
|
|
1429
|
+
sb.push("</c:v></c:pt>");
|
|
1417
1430
|
}
|
|
1418
1431
|
i++;
|
|
1419
1432
|
}
|
|
1420
1433
|
}
|
|
1421
|
-
sb.push("</c:numCache>")
|
|
1434
|
+
sb.push("</c:numCache>");
|
|
1422
1435
|
}
|
|
1423
1436
|
else if (firstCol == lastCol)
|
|
1424
1437
|
{
|
|
1425
|
-
|
|
1426
|
-
sb.push("<c:numCache>")
|
|
1427
|
-
sb.push("<c:ptCount val=\"")
|
|
1428
|
-
sb.
|
|
1429
|
-
sb.push("\"/>")
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1438
|
+
let sheet = valData.getSheet();
|
|
1439
|
+
sb.push("<c:numCache>");
|
|
1440
|
+
sb.push("<c:ptCount val=\"");
|
|
1441
|
+
sb.push(""+(lastRow - firstRow + 1));
|
|
1442
|
+
sb.push("\"/>");
|
|
1443
|
+
let row;
|
|
1444
|
+
let cell;
|
|
1445
|
+
let cellValue;
|
|
1446
|
+
let i;
|
|
1434
1447
|
i = firstRow;
|
|
1435
1448
|
while (i <= lastRow)
|
|
1436
1449
|
{
|
|
1437
|
-
if (sheet.
|
|
1450
|
+
if ((row = sheet.getItem(i)) != null)
|
|
1438
1451
|
{
|
|
1439
|
-
if (row.cells
|
|
1452
|
+
if ((cell = row.cells[firstCol]) != null && (cellValue = cell.cellValue) != null && (cell.cdt == spreadsheet.CellDataType.DateTime || cell.cdt == spreadsheet.CellDataType.Number))
|
|
1440
1453
|
{
|
|
1441
|
-
sb.push("<c:pt idx=\"")
|
|
1442
|
-
sb.
|
|
1443
|
-
sb.push("\"><c:v>")
|
|
1444
|
-
sb.
|
|
1445
|
-
sb.push("</c:v></c:pt>")
|
|
1454
|
+
sb.push("<c:pt idx=\"");
|
|
1455
|
+
sb.push(""+(i - firstRow));
|
|
1456
|
+
sb.push("\"><c:v>");
|
|
1457
|
+
sb.push(cellValue);
|
|
1458
|
+
sb.push("</c:v></c:pt>");
|
|
1446
1459
|
}
|
|
1447
1460
|
i++;
|
|
1448
1461
|
}
|
|
1449
1462
|
i++;
|
|
1450
1463
|
}
|
|
1451
|
-
sb.push("</c:numCache>")
|
|
1464
|
+
sb.push("</c:numCache>");
|
|
1452
1465
|
}
|
|
1453
1466
|
else
|
|
1454
1467
|
{
|
|
1455
|
-
sb.push("<c:numCache/>")
|
|
1468
|
+
sb.push("<c:numCache/>");
|
|
1456
1469
|
}
|
|
1457
|
-
sb.push("</c:numRef>")
|
|
1458
|
-
sb.push("</c:val>")
|
|
1470
|
+
sb.push("</c:numRef>");
|
|
1471
|
+
sb.push("</c:val>");
|
|
1459
1472
|
|
|
1460
|
-
sb.push("<c:smooth val=\"")
|
|
1461
|
-
if (series.
|
|
1462
|
-
sb.push("true")
|
|
1473
|
+
sb.push("<c:smooth val=\"");
|
|
1474
|
+
if (series.isSmooth())
|
|
1475
|
+
sb.push("true");
|
|
1463
1476
|
else
|
|
1464
|
-
sb.push("false")
|
|
1465
|
-
sb.push("\"/>")
|
|
1466
|
-
sb.push("</c:ser>")
|
|
1467
|
-
}
|
|
1477
|
+
sb.push("false");
|
|
1478
|
+
sb.push("\"/>");
|
|
1479
|
+
sb.push("</c:ser>");
|
|
1480
|
+
}
|
|
1468
1481
|
|
|
1469
1482
|
/**
|
|
1470
1483
|
* @param {string[]} sb
|
|
@@ -1935,6 +1948,9 @@ export class XLSXExporter
|
|
|
1935
1948
|
}
|
|
1936
1949
|
}
|
|
1937
1950
|
|
|
1951
|
+
/**
|
|
1952
|
+
* @param {string} dataFormat
|
|
1953
|
+
*/
|
|
1938
1954
|
static toFormatCode(dataFormat)
|
|
1939
1955
|
{
|
|
1940
1956
|
let s = [];
|