• Devexpress WPF ChartControl 多Y轴


    <Window
        x:Class="DXApplication4.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
            xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
            Title="MainWindow" Height="350" Width="525" 
        
        >
        <Grid>
            <dxc:ChartControl >
                <dxc:XYDiagram2D x:Name="diagram1">
                    <dxc:XYDiagram2D.SecondaryAxesY>
                        <dxc:SecondaryAxisY2D x:Name="y2">
                            <dxc:SecondaryAxisY2D.Title>
                                <dxc:AxisTitle Content="y2"></dxc:AxisTitle>
                            </dxc:SecondaryAxisY2D.Title>
                        </dxc:SecondaryAxisY2D>
                        <dxc:SecondaryAxisY2D x:Name="y3"/>
                    </dxc:XYDiagram2D.SecondaryAxesY>
                    <dxc:XYDiagram2D.AxisX>
                        <dxc:AxisX2D />
                    </dxc:XYDiagram2D.AxisX>
                    <dxc:XYDiagram2D.AxisY>
                        <dxc:AxisY2D  >
                            <dxc:AxisY2D.Range>
                                <dxc:AxisRange MaxValue="10" MinValue="0"></dxc:AxisRange>
                            </dxc:AxisY2D.Range>
                        </dxc:AxisY2D>      
                    </dxc:XYDiagram2D.AxisY>
                    <dxc:LineSeries2D  ArgumentDataMember="Key" ValueDataMember="Value" x:Name="series1"/>
                    <dxc:LineSeries2D dxc:XYDiagram2D.SeriesAxisY="{Binding ElementName=y2}" ArgumentDataMember="Key" ValueDataMember="Value" x:Name="series2"/>          
                    <dxc:LineSeries2D  ArgumentDataMember="Key" ValueDataMember="Value" x:Name="series3">
                        <dxc:XYDiagram2D.SeriesAxisY>
                            <Binding ElementName="y3"/>
                        </dxc:XYDiagram2D.SeriesAxisY>
                    </dxc:LineSeries2D>
                </dxc:XYDiagram2D>
            </dxc:ChartControl>
        </Grid>
    </Window>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using DevExpress.Xpf.Charts;
    using System.Data;
    
    
    namespace DXApplication4
    {
        public partial class MainWindow : Window
        {
            public MainWindow ()
            {
                InitializeComponent();
    
                Dictionary<int, int> d1 = new Dictionary<int, int>();
                d1.Add(1, 1);
                d1.Add(2, 2);
                d1.Add(3, 3);
                d1.Add(4, 4);
    
                series1.DataSource = d1;
                SecondaryAxisY2D y1 = new SecondaryAxisY2D();            
                y1.Title = new AxisTitle() { Content = "y1" };
                y1.Range = new AxisRange() { MaxValue = 10, MinValue = 0 };
                diagram1.SecondaryAxesY.Remove(y1);
                diagram1.SecondaryAxesY.Add(y1);           
                XYDiagram2D.SetSeriesAxisY(series1, y1);
    
                Dictionary<int, int> d2 = new Dictionary<int, int>();
                d2.Add(1, 2);
                d2.Add(2, 4);
                d2.Add(3, 7);
                d2.Add(4, 9);
                series2.DataSource = d2;
    
                Dictionary<int, int> d3 = new Dictionary<int, int>();
                d3.Add(1, 1);
                d3.Add(2, 5);
                d3.Add(3, 2);
                d3.Add(4, 8);
                series3.DataSource = d3;
    
            }
           
        
        }
    
    
    }
  • 相关阅读:
    使用eclipse+fiddler+微信web开发者工具调试本地微信页面
    使用微信web开发者工具调试微信企业号页面(前端页面,已发布在服务器上的)
    使用Fiddler搭建手机调试环境(我做得项目是调试微信的公众号)
    使用Apache+Dreamweaver(或者H-builder)搭建php开发环境
    mysqlbinlog的日志类型
    利用mysql的binlog恢复数据
    MySQL的binlog数据如何查看
    mysql show processlist命令 详解
    MySQL慢查询日志总结
    PHP取整函数ceil,floor,round,intval的区别
  • 原文地址:https://www.cnblogs.com/amw2738/p/3734798.html
Copyright © 2020-2023  润新知