ZedGraph 控件使用示例源代码

更新时间:2023-06-23 07:42:55 阅读: 评论:0

ZedGraph 控件使用示例源代码
//文件名:Form1.cs
using System;
using System.Collections.Generic;
techniqueusing System.ComponentModel;
using System.Data;
psychotherapyusing System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;
namespace ZedGraphTest
{
   
    public partial class Form1 : Form
    {
        int test = 6;
no matter        public static PointPairList list_AWT = new PointPairList();
        public static PointPairList list_runEff = new PointPairList();
        LineItem myCurve;
        private static int num = 1;
        public double[] getArrvalues()
明光绿豆
开童装店        {
            double[] arr = { 100, 135, 115, 125, 75, 120 };
            arr[0] += num;
            arr[1] += num * 2;
            arr[2] += num * 3;
            arr[3] += num * 4;
            arr[4] += num * 5;
            arr[5] += num * 6;
            num++;
清洁工的英文
            return arr;
        }
        public Form1()
        {
            InitializeComponent();
            // zedGraphControl1
            //
            this.zedGraphControl1.Location = new System.Drawing.Point(12, 12);
            this.zedGraphControl1.Name = "zedGraphControl1";
            this.zedGraphControl1.ScrollGrace = 0;
            this.zedGraphControl1.ScrollMaxX = 0;
            this.zedGraphControl1.ScrollMaxY = 0;
            this.zedGraphControl1.ScrollMaxY2 = 0;
            this.zedGraphControl1.ScrollMinX = 0;
            this.zedGraphControl1.ScrollMinY = 0;
            this.zedGraphControl1.ScrollMinY2 = 0;
            this.zedGraphControl1.Size = new System.Drawing.Size(647, 444);
            this.zedGraphControl1.TabIndex = 0;
            double[] db = getArrvalues();
            for (int i = 0; i < db.Length; i++)
            {
                list_AWT.Add(i, db[i]);
                list_runEff.Add(i, db[i]*1.5);
            }
        }
        private void ZedG_Load(object nder, EventArgs e)
        {
            this.zedGraphControl1.GraphPane.Title.Text = "楼市运行参数";//图表主标题
            this.zedGraphControl1.GraphPane.XAxis.Title.Text = "时间";//X轴标题
            this.zedGraphControl1.GraphPane.YAxis.Title.Text = "楼价";//Y轴标题
            this.zedGraphControl1.GraphPane.Y2Axis.Title.Text = "楼盘数量";//Y2轴标题
            //dGraphControl1.GraphPane.XAxis.Type = AxisType.Ordinal;  //x轴的最小刻度更变大一点,其他功能变化也很大
            myCurve = zedGraphControl1.GraphPane.AddCurve("AA", list_AWT, Color.Red, SymbolType.None);
            myCurve.Symbol.Fill = new increaFill(Color.Red);
            myCurve = zedGraphControl1.GraphPane.AddCurve("BB", list_runEff, Color.Blue, SymbolType.None);
            myCurve.Symbol.Fill = new Fill(Color.Blue);
            myCurve.IsY2Axis = true;        //true to assign the curve to the Y2Axis, fal to assign the curve to the YAxis
            /////////////////////////////////////////////////////////////////
            this.zedGraphControl1.GraphPane.XAxis.MajorGrid.IsVisible = true//x轴上竖着的虚线
            this.zedGraphControl1.GraphPane.YAxis.Scale.FontSpec.FontColor = Color.Red;
            this.zedGraphControl1.GraphPane.YAxis.Title.FontSpec.FontColor = Color.Red;  //y轴的title和刻度变成红色
            this.zedGraphControl1.GraphPane.YAxis.MajorTic.IsOpposite = fal;
            this.zedGraphControl1.GraphPane.YAxis.MinorTic.IsOpposite = fal//??????
            this.zedGraphControl1.GraphPane.YAxis.MajorGrid.IsZeroLine = fal// Don't display the Y zero line
            this.zedGraphControl1.GraphPane.YAxis.Scale.Align = AlignP.Inside;  //??????
            this.zedGraphControl1.GraphPane.YAxis.Scale.Min = 60;
英文童话            this.zedGraphControl1.GraphPane.YAxis.Scale.Max = 150;
            /////////////////////////////////////////////////////////////////////////////
            this2014年山东高考分数线.zedGraphControl1.GraphPane.Y2Axis.IsVisible = true;
            this新东方精英英语.zedGraphControl1.GraphPane.Y2Axis.Scale.FontSpec.FontColor = Color.Blue;
            this.zedGraphControl1.GraphPane.Y2Axis.Title.FontSpec.FontColor = Color.Blue;
            this.zedGraphControl1.GraphPane.Y2Axis.MajorTic.IsOpposite = fal;
            this.zedGraphControl1.GraphPane.Y2Axis.MinorTic.IsOpposite = fal//??????
            this.zedGraphControl1.GraphPane.Y2Axis.MajorGrid.IsVisible = true//y轴上横着的虚线

本文发布于:2023-06-23 07:42:55,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1019521.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:刻度   功能   变大   示例   运行   高考
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图