<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ChartViewer.aspx.vb" Inherits="EnsinoBasico.ChartViewer" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%--<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .k-tooltip
        {
            /*Sets border width and color*/
            border-width: 3px !important;
            border-color: gray !important; /*Sets padding*/
            padding-left: 5px !important;
            padding-right: 5px !important; /*Sets FontSize, FontFamily and color*/
            font: 15px Tahoma,Helvetica,sans-serif !important;
            color: black !important;
        }
    </style>
    <script type="text/javascript">

        function resizeChart() {
            var chart = $find('<%=RadHtmlChart1.ClientID %>');
            chart.get_element().style.width = "100%";
            chart.get_element().style.height = "100%";
            chart.repaint();
        } 
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Height="363px" Width="445px">
    </telerik:RadHtmlChart>
    <%--

    	<asp:Button ID="Button1" Text="print the chart" OnClientClick="printChartClient(); return false;"
	runat="server" />
        <asp:HiddenField ID="hfData" runat="server" />

    <div id="ff">
    
    </div>
    --%>
    <script type="text/javascript">
        //$telerik.$ is the jQuery that comes with the RadControls
        //It can be assigned to a shorter variable name or external jQuery can be used

        function printChartClient() {
            var chartContainer = $telerik.$("#jj");
            //  save the original CSS rules that will be modified
            var chartOriginalCSS = {
                display: chartContainer.css("display"),
                position: chartContainer.css("position"),
                top: chartContainer.css("top"),
                left: chartContainer.css("left"),
                zIndex: chartContainer.css("zIndex"),
                visibility: chartContainer.css("visibility")
            };
            //make sure the chart container is visible
            chartContainer.css({
                display: "block",
                position: "absolute",
                top: "6px",
                left: "1px",
                zIndex: 10000,
                visibility: "visible"
            }
			);
            var body = $telerik.$("body");
            //store the original CSS rules for the body tag that will be modified
            var bodyOriginalCSS = {
                visibility: body.css("visibility"),
                overflow: body.css("overflow"),
                background: body.css("background")
            };
            //hide the body tag
            body.css({
                visibility: "hidden",
                overflow: "hidden",
                background: "transparent"
            }
			);
            console.log("hello world");
            console.log(JSON.stringify(body));

            //call the browser print() method
            //  window.print();

            //restore the original CSS properties
            //  chartContainer.css(chartOriginalCSS);
            // body.css(bodyOriginalCSS);

            // document.getElementById('ff').innerHTML = "sss";

            return chartContainer;
        }
    </script>
    </form>
</body>
</html>
