Which C # library to use for roundness graphing software?

I am working on a metrology laboratory, and I need to develop software in C # for round-meter equipment, I already started, and I found a problem, I need software to display real-time graphics from the measurement that is being done, for this I will need use a library, for example Mscharts or Zedgraph, which updates information very quickly and supports cyclic graphs, such as Polar or radar, especially polar diagrams. The problem that I saw in most libraries is that they lack support for round graphs and are relatively slow. Does anyone have the right to a libra I could use?

Thank you for your help. PS: The software should show the following graphics: enter image description here

enter image description hereThe final software should be like this one

+4
source share
4 answers

I would make them using GDI (+) (in a winforms application).

Yes, this is a basic line drawing, but it will be strong enough for the examples you gave. You need to update your high school math, but it will give you a lot of control over the way out and it will be fast.

+1
source

Not sure if this will help or not. Xceed Charts, in its extended section, talks about how to make polar diagrams. Unfortunately, they didn’t provide any images, so you should talk to your sellers and see if you can get an evaluation copy for evaluation.

+1
source

Consider using the IMSL Numerical.NET library with roguewave

IMSL .NET Library Home

Examples of a graph that resembles what you posted above

Especially the polar plot seems to you what you need.

+1
source

I was surprised that ZedGraph does not support polar graphics out of the box, and there are very few examples on the Internet. Using this guild , I created my own polar chart with ZedGraph in C #. I hope WillKraemer has already solved its problem (4 years have passed), and someone else found my implementation useful.

Initializing ZedGraphControl:

myZg = new ZedGraphControl(); GraphPane myPane = myZg.GraphPane; // Init lists RadarPointList dseries1 = new RadarPointList(); RadarPointList dseries2 = new RadarPointList(); // Maximize available space in pane myPane.Legend.Position = LegendPos.InsideTopLeft; myPane.Title.IsVisible = false; myPane.XAxis.IsVisible = false; myPane.YAxis.IsVisible = false; myPane.Border.IsVisible = false; myPane.Chart.Border.IsVisible = false; myPane.Margin.All = 0; // Create concentric grid with 30 degrees spacing & add corresponding labels for (double i = 0; i < 36; i+=3.0) { TextObj gridlbs = new TextObj((i * 10.0).ToString("0°"), (radius + 10.0) * Math.Cos((i * 10.0 * Math.PI) / 180.0), (radius + 10.0) * Math.Sin((i * 10.0 * Math.PI) / 180.0)); gridlbs.FontSpec.Border.IsVisible = false; LineObj gridlns = new LineObj(0, 0, radius * Math.Cos((i * 10.0 * Math.PI) / 180.0), radius * Math.Sin((i * 10.0 * Math.PI) / 180.0)); myPane.GraphObjList.Add(gridlbs); myPane.GraphObjList.Add(gridlns); } // Draw circular grid, 5 should look okay for (double i = (radius / 5.0); i <= radius; i += (radius / 5.0)) { EllipseObj gridcrl = new EllipseObj(-i, i, 2.0 * i, 2.0 * i); gridcrl.ZOrder = ZOrder.E_BehindCurves; myPane.GraphObjList.Add(gridcrl); } // Make sure the pane is big enough to fit the labels around the polar plot myPane.XAxis.Scale.Min = -(radius + 20.0); myPane.XAxis.Scale.Max = (radius + 20.0); myPane.YAxis.Scale.Min = -(radius + 20.0); myPane.YAxis.Scale.Max = (radius + 20.0); _selectedRadius = radius; // Keep X & Y axis in the correct ratio to avoid distorting polar circle myZg_Resize((object)"Startup", EventArgs.Empty); myZg.Resize += new EventHandler(myZg_Resize); myZg.ZoomEvent += new ZedGraphControl.ZoomEventHandler(myZg_ZoomEvent2); // Draw snailly curves (example) for (int i = 0; i < 360; i++) { double r = (double)i/360.0 * radius; PointPair pt = new PointPair(PointPair.Missing, r, null); dseries1.Add(pt); PointPair pt2 = new PointPair(PointPair.Missing, radius - r, null); dseries2.Add(pt2); } // Curves are somple LineItem FirstCurve = myPane.AddCurve("Snail", dseries1, Color.Blue, SymbolType.None); SecondCurve = myPane.AddCurve("antiSnail", dseries2, Color.Red, SymbolType.None); // Rotate the lists to aling with labels dseries1.Rotation = 0; dseries2.Rotation = 0; 

I had to make sure that the graph is not distorted when the size of the form / control changes, so I added this to the resize event:

  protected void myZg_Resize(object sender, EventArgs e) { GraphPane pane = myZg.GraphPane; myZg.AxisChange(); bool IsXMin = ( pane.Rect.Width < pane.Rect.Height ) ? true : false; if (IsXMin) { // Scale based on X (width) pane.XAxis.Scale.Max = (radius + 20.0); pane.XAxis.Scale.Min = -(radius + 20.0); double xPixPerUnit = (double)pane.Chart.Rect.Width / (pane.XAxis.Scale.Max - pane.XAxis.Scale.Min); pane.YAxis.Scale.Max = (double)pane.Chart.Rect.Height / xPixPerUnit / 2.0; pane.YAxis.Scale.Min = -pane.YAxis.Scale.Max; myZg.AxisChange(); } else { // Scale based on Y (height) pane.YAxis.Scale.Max = (radius + 20.0); pane.YAxis.Scale.Min = -(radius + 20.0); double yPixPerUnit = (double)pane.Chart.Rect.Height / (pane.YAxis.Scale.Max - pane.YAxis.Scale.Min); pane.XAxis.Scale.Max = (double)pane.Chart.Rect.Width / yPixPerUnit / 2.0; pane.XAxis.Scale.Min = -pane.XAxis.Scale.Max; myZg.AxisChange(); } } 

In addition, I decided to block the user from any scaling actions:

  protected void myZg_ZoomEvent2(ZedGraphControl sender, ZoomState oldState, ZoomState newState) { myZg_Resize("zoomevent", EventArgs.Empty); } 

The result is as follows:

enter image description here

Suggestions are always welcome!

+1
source

All Articles