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];
  • 相关阅读:
    Golang 连接Kafka
    Go tail库
    Kubernetes busybox nslookup问题
    数据结构与算法之美 06 | 链表(上)-如何实现LRU缓存淘汰算法
    python 中model.py详解
    解决 python No migrations to apply 无法生成表
    django的使用INNODE的方式,排除错误MySQL Strict Mode is not set for database connection 'default'
    IndentationError: unindent does not match any outer indentation level
    Mac中 pip3 install mysqlclient 报错
    mac下如何搭建python开发环境
  • 原文地址:https://www.cnblogs.com/xinyus/p/3174701.html
Copyright © 2011-2022 走看看