XLSX Chart position
-
Hello,
I am attempting to change the position of a chart in Excel, but I'm unsure how to proceed.
I discovered that the chart's position is located at the path xl/drawings/drawing1.xml, and the relevant element is xdr:twoCellAnchor. I tried modifying xdr:from and xdr:to using xlsxMerge or xlsxReplace, but unfortunately, I did not achieve any results.
for example:
{{#xlsxMerge "xl/drawings/drawing1.xml" (replace "xdr:wsDr.xdr:twoCellAnchor.xdr:from.xdr:row" "12" 20)}}
<c t="inlineStr"><is><t>20</t></is></c>
{{/xlsxMerge}}https://playground.jsreport.net/w/TomiDeak/~avzfgwq
![alt text]( image url)
Do you have any suggestions for this?
-
It looks like our xlsx transformation helpers don't support collons in paths. I've submitted it to the backlog
https://github.com/jsreport/jsreport/issues/1192However, you can do the same in your custom helper
function updateRow(opts) { const drawingJson = opts.data.root.$xlsxTemplate['xl/drawings/drawing1.xml'] drawingJson['xdr:wsDr']['xdr:twoCellAnchor'][0]['xdr:from'][0]['xdr:row'][0] = '20' }
updated workspace
https://playground.jsreport.net/w/anon/QFuSeybq
-
Thank you, it helped me a lot.