Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added chart responsive support #1057

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions js/render-google.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// this will store the images for each chart rendered.
var __visualizer_chart_images = [];
var chartWrapperError = [];
var isResizeRequest = false;

(function($) {
var gv;
Expand Down Expand Up @@ -40,7 +41,7 @@ var chartWrapperError = [];
function renderSpecificChart(id, chart) {
var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;

if ( $('#' + id).hasClass('visualizer-chart-loaded') || ( 'canvas' !== id && $('#' + id).children( ':not(.loader)' ).length > 0 ) ) {
if ( ! window.isResizeRequest && ( $('#' + id).hasClass('visualizer-chart-loaded') || ( 'canvas' !== id && $('#' + id).children( ':not(.loader)' ).length > 0 ) ) ) {
return;
}

Expand Down Expand Up @@ -482,8 +483,9 @@ var chartWrapperError = [];
var resizeTimeout;

$(document).ready(function() {
$(window).resize(function() {
$(window).resize(function(e) {
clearTimeout(resizeTimeout);
window.isResizeRequest = 'undefined' !== typeof e.originalEvent ? true : false;
resizeTimeout = setTimeout(render, 100);
});

Expand Down
Loading