Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:43:55+00:00 2026-06-17T09:43:55+00:00

I would like to dock an OxyPlot graph in my windows form and graph

  • 0

I would like to dock an OxyPlot graph in my windows form and graph the function y = 2x - 7. I have downloaded OxyPlot and added the references to my project. I use the following code to add the plot to my form:

public partial class GraphForm : Form
{
    public OxyPlot.WindowsForms.Plot Plot;

    public Graph()
    {
        InitializeComponent();

        Plot = new OxyPlot.WindowsForms.Plot();
        Plot.Model = new PlotModel();
        Plot.Dock = DockStyle.Fill;
        this.Controls.Add(Plot);

        Plot.Model.PlotType = PlotType.XY;
        Plot.Model.Background = OxyColor.FromRgb(255, 255, 255);
        Plot.Model.TextColor = OxyColor.FromRgb(0, 0, 0);
    }
}

With this code I see the white background, the control has been created, but it’s only a white background. I’ve looked around the members of the OxyPlot.Plot class but I couldn’t find a way to plat my equation. How can I plot my equation in the graph?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:43:56+00:00Added an answer on June 17, 2026 at 9:43 am

    You need to add some data to display, you add this to the Models Series property.

    Line (X,Y) graph example.

        public Graph()
        {
            InitializeComponent();
    
            Plot = new OxyPlot.WindowsForms.Plot();
            Plot.Model = new PlotModel();
            Plot.Dock = DockStyle.Fill;
            this.Controls.Add(Plot);
    
            Plot.Model.PlotType = PlotType.XY;
            Plot.Model.Background = OxyColor.FromRGB(255, 255, 255);
            Plot.Model.TextColor = OxyColor.FromRGB(0, 0, 0);
    
            // Create Line series
            var s1 = new LineSeries { Title = "LineSeries", StrokeThickness = 1 };
            s1.Points.Add(new DataPoint(2,7));
            s1.Points.Add(new DataPoint(7, 9));
            s1.Points.Add(new DataPoint(9, 4));
    
            // add Series and Axis to plot model
            Plot.Model.Series.Add(s1);
            Plot.Model.Axes.Add(new LinearAxis(AxisPosition.Bottom, 0.0, 10.0));
            Plot.Model.Axes.Add(new LinearAxis(AxisPosition.Left, 0.0, 10.0));
    
        }
    

    This Example:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to remove from Mac OS-X taskbar (Dock) the XCode's recent project
I just would like to know if it is possible to dock a windows
I would like the Dock Icon to use the method makekeyandorderfront to open the
I have main window and several child windows, i would like to show main
I've got a dock of icons that I would like vertically centered. This of
I would like to build a WPF window application using the following layout structure.
I'm creating a Sencha Touch application. I would like to have a banner docked
I have written an SWT Java application and would like to configure it to
I have a forms app and when it starts up I would like it
does someone know something about TV output with dock connector. I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.