http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 5442|回复: 1

[咨询站长] C# winform中用oxyplot画散点图时有bug怎么解决?

[复制链接]
发表于 2018-4-24 09:56:50 | 显示全部楼层 |阅读模式
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.Annotations;
using OxyPlot.Axes;
using OxyPlot.Reporting;
using OxyPlot.WindowsForms;
using OxyPlot.Xamarin;
//using OxyPlot.Wpf;

namespace SPC
{
   
    public partial class KZTForm : Form
    {
        
        public KZTForm()
        {
            this.InitializeComponent();
            var myModel = new PlotModel { Title = "X" };
            myModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)"));
            this.plot1.Model = myModel;
         
            var myModel1 = new PlotModel { Title = "Xbar" };
            myModel1.Series.Add(new FunctionSeries(Math.Sin, 0, 10, 0.1, "sin(x)"));
            this.plot2.Model = myModel1;
            var model1 = new PlotModel { Title = "图的标题" };
            var scatterSeries = new ScatterSeries { MarkerType = MarkerType.Diamond, Title = "散点系列点的名称" };//散点图
            var lineSeries1 = new LineSeries("线系列点的名称");  //线图   
            model1.Axes.Add(new LinearAxis(AxisPosition.Bottom, "X坐标的名称"));
            model1.Axes.Add(new LinearAxis(AxisPosition.Left, "Y坐标的名称"));
            model1.Axes.Add(new LinearAxis(AxisPosition.Right, "右边Y坐标的名称"));
            model1.Axes.Add(new LinearAxis(AxisPosition.Right, "右边Y坐标的名称"));//正常坐标
            int[] p = { 1, 2, 3, 5, 8, 9,10,12,23,22,33,44,55,66};
            for (int i = 0; i < 10; i++)
            {
                var x = i;
                var y = p;
                scatterSeries.Points.Add(new ScatterPoint(x, y));
                lineSeries1.Points.Add(new DataPoint(x, y + 10));
            }
            model1.Series.Add(scatterSeries);//添加散点图到控件
            model1.Series.Add(lineSeries1);
            this.plot2.Model = model1;
        }
        
        private void KZTForm_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
        }
    }
}
//附件是相关文件

KZTForm.cs.zip

4.56 KB, 下载次数: 36, 下载积分: 金钱 -1

相关文件



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
 楼主| 发表于 2018-4-24 14:23:01 | 显示全部楼层
严重性        代码        说明        项目        文件        行        禁止显示状态
错误        CS1729        “LineSeries”不包含采用 1 个参数的构造函数        SPC        D:\毕业设计\SPC\SPC\KZTForm.cs        41        活动的
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-3-29 19:11

© 2014-2021

快速回复 返回顶部 返回列表