Skip to content

Commit

Permalink
Use bounding client rect width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
eddylynch committed Jan 6, 2025
1 parent 356c9d3 commit 03fc1f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var BEFORE_CHART_FORMAT_TEMPLATE =
// Note: This function is called by the manifest after loading the control add-in.
function Initialize() {
window.addEventListener('resize', function () {
var width = window.document.documentElement.clientWidth;
var height = window.document.documentElement.clientHeight;
var width = window.document.documentElement.getBoundingClientRect().width;
var height = window.document.documentElement.getBoundingClientRect().height;

onChartSizeChanged(width, height);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var BEFORE_CHART_FORMAT_TEMPLATE =
// Note: This function is called by the manifest after loading the control add-in.
function Initialize() {
window.addEventListener('resize', function () {
var width = window.document.documentElement.clientWidth;
var height = window.document.documentElement.clientHeight;
var width = window.document.documentElement.getBoundingClientRect().width;
var height = window.document.documentElement.getBoundingClientRect().height;

onChartSizeChanged(width, height);
});
Expand Down Expand Up @@ -414,7 +414,7 @@ function createChart(chartData) {
});

var width = chart.container.getBoundingClientRect().width;
var height = chart.container.getBoundingClientRect()
var height = chart.container.getBoundingClientRect().height;

// Update the size-dependent properties
if (width > 0 && height > 0) {
Expand Down

0 comments on commit 03fc1f4

Please sign in to comment.