locked
How to Open Page as a pop up window in Google Charts plotOptions RRS feed

  • Question

  • User-1971168174 posted

    Hi,

    Below code successfully opens up new page in new window,but i need to open it as a popup window with fixed size  something like below...

    "window.open('" + url + "', 'popup_window', 'width=700,height=600,left=100,top=100,resizable=yes');";

    Thanks in advance.

      plotOptions: {
    
                        series: {
                            turboThreshold: 6000,
                            cursor: 'pointer',
                            point: {
                                events: {
                                    click: function (e) {
                                        
                                        var datetime; //get the datetime from the prepared array  according to the 
                                        for (var i = 1; i < dataObjects.length; i++) {
    
                                            if (dataObjects[i].BatchId == this.category) {
    
                                                datetime = dataObjects[i].datetime;
                                                break;
                                            }
                                        }
    
                                        hs.htmlExpand(null, {
                                            pageOrigin: {
                                                x: (e.pageX || e.clientX) - 100,
                                                y: (e.pageY || e.clientY) + 60
                                            },
    
                                            headingText: 'X_Parameter: ' + this.category + '<br/> ',
    
                                           
                                            maincontentText: 'Datetime:' + datetime + '<br/> ' + 'Weight:' + this.y + '<br/> ' + ' <a target="_blank"  href="default.aspx?uid1=' + this.category + '" > Click here</a>' + '<br/> ' + '<a target="_blank"  href="disable.aspx?uid2=' + datetime + '"> Click here to open </a>' + "<br/>" ,
                                            width: 300,
    
    
                                        });
    
                                    }
                                }
                            },
                            marker: {
                                lineWidth: 1
                            }
                        }
                    },

    Thanks!

    Friday, December 28, 2018 9:26 AM

Answers

  • User-271186128 posted

    Hi neerajkumarmodi,

    Below code successfully opens up new page in new window,but i need to open it as a popup window with fixed size  something like below...

    "window.open('" + url + "', 'popup_window', 'width=700,height=600,left=100,top=100,resizable=yes');";

    maincontentText: 'Datetime:' + datetime + '<br/> ' + 'Weight:' + this.y + '<br/> ' + ' <a target="_blank"  href="default.aspx?uid1=' + this.category + '" > Click here</a>' + '<br/> ' + '<a target="_blank"  href="disable.aspx?uid2=' + datetime + '"> Click here to open </a>' + "<br/>" ,
                                       

    According to your code, it seems that you want to open the hyperlink in a popup up window. If that is the case, try to add onclick event in the a tag, 

    Code like this (you could change the href attribute):

    '<a href="http://www.facebook.com/sharer" target="_blank"  onclick="window.open(this.href, \'mywin\',\'left=20,top=20,width=500,height=500,toolbar=1,resizable=yes\'); return false;" >Share this</a>'

    Best regards,
    Dillion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 29, 2018 3:29 AM