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 7807567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:53:26+00:00 2026-06-02T02:53:26+00:00

I am working on my own graph drawing application. I have got the graph

  • 0

I am working on my own graph drawing application. I have got the graph and the updating mechanisme working like i want to. Now I am trying to draw a grid, So i need some lines on the axis of my graph, so I came up with this little loop:

        Gridx = new Line();

        while (x <= _XAxisSize)
        {

            gridx.X1 = x; 
            gridx.X2 = x;
            gridx.Y1 = _YAxisSize - 20;
            gridx.Y2 = _YAxisSize + 20;

            x = x + XgridSize;

            gridx.UpdateLayout();
        }

This doesn’t work, because it only draws one line (the last point of the loop). So i need to draw multiple lines on that axes. How dow i accomplish something like that, using either the line() from the system.Windows.Shapes library, or any other shape in that library

Thanks

  • 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-02T02:53:28+00:00Added an answer on June 2, 2026 at 2:53 am

    If you want multiple lines, you need to create multiple lines:

    while (x <= _XAxisSize)
    {
        var gridx = new Line();
    
        gridx.X1 = x; 
        gridx.X2 = x;
        gridx.Y1 = _YAxisSize - 20;
        gridx.Y2 = _YAxisSize + 20;
    
       //need to add gridx to your view here
    
        x = x + XgridSize;
    }
    

    However, for such static lines you might be better off looking at using a GeometryDrawing which has much less overhead than the Line shape. See here for details about the differences.

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

Sidebar

Related Questions

I'm currently working on my own little online pixel editor. Now I'm trying to
I've been working on my own django based blog (like everyone, I know) to
I'm working through SICP on my own, so I don't have an instructor to
I'm working on an application that allows users to add their own RSS feeds
I am working on an application where users 'fight' to own larger parts of
I'm working on my own python testing framework which I'd like to use within
I am student and working my own application for knowing how to use Google
I'm working on my own small Twitter application in C#. I've managed to serialize
I'm working on my own private Windows desktop application user interface framework based on
I have started working on my own project, but I am stuck due 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.