How to start developing diagrams in C #

I would like to try to create a charting tool (something like entity-relationship diagrams that you can create in SQL Server 2005, or class diagrams that you can create in Microsoft Visual Studio)

Those. I would like to create boxes, paste text in them, edit text and draw lines between the drawers.

I have never done such programming, so I don’t know where to start.

Am I using XAML or creating a canvas and moving on to graphical programming?

I know that there are some chart tools, but I really would like to know about it by doing it myself.

+6
c # graphics diagram
source share
4 answers

The rendering engine that you choose is somewhat arbitrary - you will have to do a lot of work no matter what structure you use.

Having implemented such a system in C # and WinForms, I can honestly say that this is a bad way. Stick to WPF / Silverlight. Following the trends, write the Silverlight 4 app so you can deploy them on desktop computers across multiple platforms.

I found that there are many high-level decisions you have to make that are even more important than the rendering engine used. Some of them:

  • How much do you need to scale and pan?

    • Do you want continuous zoom so you can do neat animations for your data?
    • Need to be able to pan with your mouse?
    • How can you distinguish panning movements from dragging drawers and handles?
    • Will you change the content arrangement in the boxes depending on the current zoom level? or will you rely on font scaling?
  • Do you need a grouping? As soon as you get some tables on the screen, you will soon realize that the ability to hide some details is useful. The ability to group boxes and show that the group in a symbolic form as a “meta” field allows the user to get rid of unwanted distractions.

  • Do you need a search? Again, trying to deal with the problem of “too much on the screen”, it’s good to have a search box that hides everything that does not match the search (gray, hidden, etc.).

  • How the user interacts with the keyboard. Since your audience may include programmers, you will want to think a lot about making all your diagrams editable only from the keyboard. This means that you like to manipulate focus and also use keyboard shortcuts.

+1
source share

Well, here is the foundation of one in CodeProject , with source and tutorial. For WPF.

Also see this question .

+2
source share

WPF / XAML is a great place to start something like this. You will want to explore WPF as a whole, focusing on user controls (for tables) and drawing lines (for relationships.)

+2
source share

As Frank noted, creating interactive graphics is big business. Many companies are already there, spent millions of dollars improving it. It will depend on how much interactivity you want. I would advise you to choose a graphical application that is extensible or has an API that fits your budget. The best of them (in my opinion) in the field of CAD, such as AutoCAD (£ 4k / seat), TurboCAD, VeCAD (£ 200 / place); and everyone has packages that will allow you to resell your product within yours.

+1
source share

All Articles