0

I try to display a simple scatter chart with the API office.js. For the same code and data, the scatter chart displayed is correct with excel desktop but incorrect with excel online.

On excel desktop:

enter image description here

On Excel online:

enter image description here

The data used are:

enter image description here

I reproduce this in the Script Lab tool and I have export a gist. The gist is available on: problemOnXYScatterChart.EXCEL.yaml

For testing,

1.click on "Create table" button (to create the table)

2.click on "Create an xy-scatter chart" button (to display the scatter chart)

Launch the snippet on Excel desktop and Excel online.

=> The chart displayed on Excel online is incorrect.

Thanks in advance for your help.

Sami.S
  • 267
  • 1
  • 13
  • This looks like a bug. Please create an issue in the [office-js repo](https://github.com/OfficeDev/office-js/issues/new/choose). – Rick Kirkham May 21 '21 at 19:10
  • Tried the same on production, however I cannot repro the issue. Anything I may miss here? – xiaochun May 21 '21 at 22:44
  • @xiaochun to reproduce the issue, the selected cell must be set out of the range data used for the chart before displayed it. – Sami.S May 24 '21 at 11:07

2 Answers2

2

I can repro the issue the issue is one known issue we are checking. To workaround it, you can put the selection in one of the table cell by range.select() before inserting chart to unblock you first.

Rita
  • 72
  • 3
1

After exchanging in PM with Microsoft team, I got the following response:

"I can repro it, the trigger point is whether select the data range before adding the chart. If selecting the data range before adding chart, this issue will not repro. Other wise it will repro, when you unselect the data range. This a known issue (5008488) that team is working on now, the reason is that when you unselect the data range and then add the chart, the row and column are wrongly switched for Excel online. Team is working the issue, the code has been checked in, it still need some time to deploy and roll out. We will let you know you can verify the fix."

Sami.S
  • 267
  • 1
  • 13