笔记一下

<%@ Page Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="PubClientQuery.aspx.cs"
    Inherits="IMDashBoard.Web.PubClientQuery" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="Label1" runat="server"></asp:Label>
    <table border="1">
        <tr>
            <td>
            </td>
            <td>
                <asp:TextBox ID="txtDateFrom" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtDateTo" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="Button" OnClick="btnSearch_Click" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Chart ID="Chart1" runat="server" Height="411px" Width="589px">
                    <Legends>
                        <asp:Legend BackColor="Transparent" Name="Legend1" DockedToChartArea="ChartArea1"
                            Alignment="Far" Docking="Top" IsDockedInsideChartArea="False">
                            <Position Height="8.026756" Width="15.4154158" X="82.5" Y="3" />
                        </asp:Legend>
                    </Legends>
                    <Series>
                        <asp:Series Name="Series1" Color="49,130,239" Legend="Legend1" LegendText="CPI指数%"
                            IsValueShownAsLabel="false" Font="Microsoft Sans Serif, 6.5pt" ChartArea="ChartArea1"
                            CustomProperties="DrawingStyle=Cylinder">
                        </asp:Series>
                    </Series>
                    <BorderSkin SkinStyle="Emboss" />
                    <ChartAreas>
                        <asp:ChartArea Name="ChartArea1" BackColor="OldLace" BorderColor="64, 64, 64, 64"
                            ShadowColor="Transparent" BackGradientStyle="TopBottom" BackSecondaryColor="White">
                            <Position Height="89.30075" Width="79.57783" X="4.768868" Y="0.699249268" />
                            <InnerPlotPosition Height="87.85704" Width="88.67226" X="4.32774353" 
                                Y="4.9395" />
                        </asp:ChartArea>
                       
                    </ChartAreas>
                </asp:Chart>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
    </table>
</asp:Content>
  using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Data.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using IMDashBoard.DAL;
using System.Collections.Generic;
namespace IMDashBoard.Web
{
    public partial class PubClientQuery : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           string calscript = "$(function(){$('#" + txtDateFrom.ClientID + "').datepicker({yearRange: '1900:2099',showOn: 'both', buttonImage: 'PIC/calendar.gif', buttonImageOnly: true,showButtonPanel: true});});";
           Page.ClientScript.RegisterStartupScript(this.GetType(), txtDateFrom.ClientID, calscript, true);
           string calscript2 = "$(function(){$('#" + txtDateTo.ClientID + "').datepicker({yearRange: '1900:2099',showOn: 'both', buttonImage: 'PIC/calendar.gif', buttonImageOnly: true,showButtonPanel: true});});";
           Page.ClientScript.RegisterStartupScript(this.GetType(), txtDateTo.ClientID, calscript2, true);
           string s = txtDateFrom.Text;
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string startDate = txtDateFrom.Text;
            string endDate = txtDateTo.Text;
            DateTime sd = DateTime.Parse(startDate);
            DateTime ed = DateTime.Parse(endDate);
            DSDataContext ds = new DSDataContext();
            var s = ds.getALL(sd, ed);
            Chart1.Series["Series1"].Points.DataBindXY(s, "d", s, "cpi");

        }

        
    }
}
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值