<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Integrating_SL4Chart_ASP.NET.Web.Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
</head>
<body style="height: 100%; margin: 0;">
    <form id="form1" runat="server" style="height: 100%;" dir="ltr">
    <script type="text/javascript">
        var silverlightControl;
        function onSilverlightLoaded(sender, args) {
            silverlightControl = sender.getHost();
        }
        function ColorChanged(sender, args) {
            silverlightControl.content.slChartPage.SeriesColor = sender.get_selectedColor();
        }
        function Show3D_Click(sender) {
            var checked = sender.checked;
            silverlightControl.content.slChartPage.Show3D = checked;
            if (checked) {
                $get("ColorPicker").style.display = "none";
                $get("ColorPickerLbl").style.display = "none";
                $get("ShowTooltips").style.display = "none";
                $get("ShowTooltipsLbl").style.display = "none";
                $get("HideElements").style.display = "block";
                $get("HideElementsLbl").style.display = "block";
                $get("HideElementsOnRotation").checked = false;
            }
            else {
                $get("ColorPicker").style.display = "block";
                $get("ColorPickerLbl").style.display = "block";
                $get("ShowTooltips").style.display = "block";
                $get("ShowTooltipsLbl").style.display = "block";
                $get("ShowItemTooltips").checked = false;
                $get("HideElements").style.display = "none";
                $get("HideElementsLbl").style.display = "none";
            }
        }
        function AxisXTitleTextBox_Changed(sender, args) {
            silverlightControl.content.slChartPage.AxisXTitle = args.get_newValue();
        }
        function AxisYTitleTextBox_Changed(sender, args) {
            silverlightControl.content.slChartPage.AxisYTitle = args.get_newValue();
        }
        function ShowItemLabels_Click(sender) {
            silverlightControl.content.slChartPage.ShowItemLabels = sender.checked;
        }
        function ShowItemTooltips_Click(sender) {
            silverlightControl.content.slChartPage.ShowItemTooltips = sender.checked;
        }
        function HideElementsOnRotation_Click(sender) {
            silverlightControl.content.slChartPage.HideElementsOnRotation = sender.checked;
        }
        function ShowXAxis_Click(sender) {
            silverlightControl.content.slChartPage.ShowXAxis = sender.checked;
        }
        function ShowYAxis_Click(sender) {
            silverlightControl.content.slChartPage.ShowYAxis = sender.checked;
        }
        function ShowXAxisGridlines_Click(sender) {
            silverlightControl.content.slChartPage.ShowXAxisGridlines = sender.checked;
        }
        function ShowYAxisGridlines_Click(sender) {
            silverlightControl.content.slChartPage.ShowYAxisGridlines = sender.checked;
        }
        function ShowXAxisStriplines_Click(sender) {
            silverlightControl.content.slChartPage.ShowXAxisStriplines = sender.checked;
        }
        function ShowYAxisStriplines_Click(sender) {
            silverlightControl.content.slChartPage.ShowYAxisStriplines = sender.checked;
        }
        function AxisXFormat_Changed(sender, args) {
            silverlightControl.content.slChartPage.AxisXFormat = args.get_item().get_text();
        }
        function AxisYFormat_Changed(sender, args) {
            silverlightControl.content.slChartPage.AxisYFormat = args.get_item().get_text();
        }
        function ItemsFormat_Changed(sender, args) {
            silverlightControl.content.slChartPage.ItemsFormat = args.get_item().get_text();
        }
        function SeriesColorCombo_Changed(sender, args) {
            silverlightControl.content.slChartPage.SeriesColor = args.get_item().get_text();
        }
    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style="height: 400px;">
        <object width="100%" height="100%" type="application/x-silverlight-2" data="data:application/x-silverlight-2,">
            <param name="source" value="../../ClientBin/Integrating_SL4Chart_ASP.NET.xap" />
            <param name="onerror" value="onSilverlightError" />
            <param name="onload" value="onSilverlightLoaded" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="4.0.50401.0" />
            <param name="autoUpgrade" value="true" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none;">
                <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
                    style="border-style: none" />
            </a>
        </object>
        <iframe id="_sl_historyFrame" style='visibility: hidden; height: 0px; width: 0px;
            border: 0px'></iframe>
    </div>
    <telerik:radformdecorator id="RadFormDecorator1" runat="server" skin="Telerik" decoratedcontrols="All" />
    <table>
        <tr>
            <td>
                Show 3D chart:
            </td>
            <td>
                <asp:CheckBox ID="Show3D" runat="server" onclick="Show3D_Click(this);" />
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <div id="ColorPickerLbl">
                    Series color:
                </div>
            </td>
            <td>
                <div id="ColorPicker">
                    <telerik:radcolorpicker id="RadColorPicker1" runat="server" showemptycolor="false"
                        preset="Standard" onclientcolorchange="ColorChanged">
                    </telerik:radcolorpicker>
                </div>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                AxisXTitle:
            </td>
            <td>
                <telerik:radtextbox id="AxisXTitleTextBox" runat="server" width="220px">
                    <ClientEvents OnValueChanged="AxisXTitleTextBox_Changed" />
                </telerik:radtextbox>
            </td>
            <td>
                <div id="ShowTooltips">
                    <asp:CheckBox ID="ShowItemTooltips" runat="server" onclick="ShowItemTooltips_Click(this);" />
                </div>
                <div id="HideElements" style="display: none;">
                    <asp:CheckBox ID="HideElementsOnRotation" runat="server" onclick="HideElementsOnRotation_Click(this);" />
                    <br />
                </div>
            </td>
            <td>
                <div id="ShowTooltipsLbl">
                    Show item tooltips.
                </div>
                <div id="HideElementsLbl" style="display: none;">
                    Hide elements on rotation
                </div>
            </td>
            <td>
                <asp:CheckBox ID="ShowXAxisGridlines" runat="server" onclick="ShowXAxisGridlines_Click(this);" />
            </td>
            <td>
                Show X axis gridlines.
            </td>
        </tr>
        <tr>
            <td>
                AxisYTitle:
            </td>
            <td>
                <telerik:radtextbox id="AxisYTitleTextBox" runat="server" width="220px">
                    <ClientEvents OnValueChanged="AxisYTitleTextBox_Changed" />
                </telerik:radtextbox>
            </td>
            <td>
                <asp:CheckBox ID="ShowItemLabels" runat="server" Checked="true" onclick="ShowItemLabels_Click(this);" />
            </td>
            <td>
                Show item labels.
            </td>
            <td>
                <asp:CheckBox ID="ShowYAxisGridlines" runat="server" onclick="ShowYAxisGridlines_Click(this);" />
            </td>
            <td>
                &nbsp;Show Y axis gridlines.
            </td>
        </tr>
        <tr>
            <td>
                Axis X format:
            </td>
            <td>
                <telerik:radcombobox id="AxisXFormat" runat="server" onclientselectedindexchanged="AxisXFormat_Changed"
                    width="220px">
                    <Items>
                        <telerik:RadComboBoxItem Text="MMM/dd/yy" />
                        <telerik:RadComboBoxItem Text="MM/dd/yyyy" />
                        <telerik:RadComboBoxItem Text="Day: #VAL{dddd}" />
                        <telerik:RadComboBoxItem Text="HH:mm:ss" />
                        <telerik:RadComboBoxItem Text="yyyy MMMM" />
                    </Items>
                </telerik:radcombobox>
            </td>
            <td>
                <asp:CheckBox ID="ShowXAxis" runat="server" Checked="true" onclick="ShowXAxis_Click(this);" />
            </td>
            <td>
                Show X axis.
            </td>
            <td>
                <asp:CheckBox ID="ShowXAxisStriplines" runat="server" onclick="ShowXAxisStriplines_Click(this);" />
            </td>
            <td>
                &nbsp;Show X axis striplines.
            </td>
        </tr>
        <tr>
            <td>
                Axis Y format:
            </td>
            <td>
                <telerik:radcombobox id="AxisYFormat" runat="server" onclientselectedindexchanged="AxisYFormat_Changed"
                    width="220px">
                    <Items>
                        <telerik:RadComboBoxItem Text="N" />
                        <telerik:RadComboBoxItem Text="C" />
                        <telerik:RadComboBoxItem Text="Amount: #VAL{C0}" />
                    </Items>
                </telerik:radcombobox>
            </td>
            <td>
                <asp:CheckBox ID="ShowYAxis" runat="server" Checked="true" onclick="ShowYAxis_Click(this);" />
            </td>
            <td>
                Show Y axis.
            </td>
            <td>
                <asp:CheckBox ID="ShowYAxisStriplines" runat="server" Checked="true" onclick="ShowYAxisStriplines_Click(this);" />
            </td>
            <td>
                Show Y axis striplines.
            </td>
        </tr>
        <tr>
            <td>
                Chart item format:
            </td>
            <td>
                <telerik:radcombobox id="ChartItemFormat" runat="server" onclientselectedindexchanged="ItemsFormat_Changed"
                    width="220px">
                    <Items>
                        <telerik:RadComboBoxItem Text="N" />
                        <telerik:RadComboBoxItem Text="C" />
                        <telerik:RadComboBoxItem Text="Amount: #Y{C0}" />
                    </Items>
                </telerik:radcombobox>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
