summaryrefslogtreecommitdiff
path: root/chart.go
diff options
context:
space:
mode:
Diffstat (limited to 'chart.go')
-rw-r--r--chart.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/chart.go b/chart.go
index 978a2f9..c5b8fc8 100644
--- a/chart.go
+++ b/chart.go
@@ -16,7 +16,6 @@ import (
"encoding/xml"
"errors"
"fmt"
- "path/filepath"
"strconv"
"strings"
)
@@ -802,9 +801,7 @@ func (f *File) AddChartSheet(sheet, format string, combo ...string) error {
f.addContentTypePart(sheetID, "chartsheet")
f.addContentTypePart(drawingID, "drawings")
// Update workbook.xml.rels
- wbPath := f.getWorkbookPath()
- wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator))
- rID := f.addRels(wbRelsPath, SourceRelationshipChartsheet, fmt.Sprintf("/xl/chartsheets/sheet%d.xml", sheetID), "")
+ rID := f.addRels(f.getWorkbookRelsPath(), SourceRelationshipChartsheet, fmt.Sprintf("/xl/chartsheets/sheet%d.xml", sheetID), "")
// Update workbook.xml
f.setWorkbook(sheet, sheetID, rID)
chartsheet, _ := xml.Marshal(cs)