zoukankan      html  css  js  c++  java
  • silverlight 图形报表开发

    前端:

    <UserControl x:Class="SLThree.CharReport"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:c="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
        xmlns:f="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
        mc:Ignorable="d"
        d:DesignHeight="500" d:DesignWidth="800">
    
        <Grid x:Name="LayoutRoot" Background="White">
            <StackPanel Width="400" Height="400" Margin="0,20,400,80">
                <c:Chart x:Name="mychart" Height="312">
                    <c:ColumnSeries Title="销售额" DependentValueBinding="{Binding Amount}"
                                IndependentValueBinding="{Binding Day}">
                    </c:ColumnSeries>
                </c:Chart>
            </StackPanel>
            <StackPanel Width="400" Height="400" Margin="400,20,0,80">
                <c:Chart x:Name="mychart2" Height="312">
                    <c:PieSeries Title="销售额" DependentValueBinding="{Binding Amount}" IndependentValueBinding="{Binding Day}"></c:PieSeries>
                </c:Chart>
            </StackPanel>
        </Grid>

    后台:

     public CharReport()
            {
                InitializeComponent();
                MyWebService.WebService1SoapClient client = new MyWebService.WebService1SoapClient();
                client.GetAllSalesCompleted += new EventHandler<MyWebService.GetAllSalesCompletedEventArgs>(client_GetAllSales);
                client.GetAllSalesAsync();
            }
    
            void client_GetAllSales(object sender, MyWebService.GetAllSalesCompletedEventArgs e)
            {
                if (e.Error != null)
                {
                    HtmlPage.Window.Alert(e.Error.Message);
                    return;
                }
                ((ColumnSeries)(this.mychart.Series[0])).ItemsSource = e.Result;
                ((PieSeries)(this.mychart2.Series[0])).ItemsSource = e.Result;
            }

     第二种:

    前台:
      <c:Chart x:Name="mychart" Height="312">
                <c:ColumnSeries Title="上周销售额" DependentValueBinding="{Binding Amount}"
                                IndependentValueBinding="{Binding Day}">
                </c:ColumnSeries>
                <c:ColumnSeries Title="本周销售额" DependentValueBinding="{Binding Amount}"
                                IndependentValueBinding="{Binding Day}">
                </c:ColumnSeries>
            </c:Chart>

    后台:

      ((ColumnSeries)(this.mychart.Series[0])).ItemsSource = e.Result[0];
                ((ColumnSeries)(this.mychart.Series[1])).ItemsSource = e.Result[1];
  • 相关阅读:
    K8S集群组件
    K8S概念
    yaml格式
    Linux下升级openssl
    cpu的核心数及线程关系
    bzoj4941: [Ynoi2016]镜子里的昆虫
    bzoj4940: [Ynoi2016]这是我自己的发明
    bzoj4939: [Ynoi2016]掉进兔子洞
    bzoj4867: [Ynoi2017]舌尖上的由乃
    bzoj 4866: [Ynoi2017]由乃的商场之旅
  • 原文地址:https://www.cnblogs.com/xinyus/p/3174701.html
Copyright © 2011-2022 走看看