zedgraph

Zed-Graph Set scale to default programmatically

会有一股神秘感。 提交于 2019-12-23 12:07:56
问题 I've got a winforms application which uses zed-graph library to plot graphs. When I right-click on the control (while application is running) a context menu shows up and I can choose Set Scale to default . How do I achive this Set Scale to default -behaviour programmatically? 回答1: For each x- and y-axis following code is executed: _scale._minAuto = true; _scale._maxAuto = true; _scale._majorStepAuto = true; _scale._minorStepAuto = true; _crossAuto = true; _scale._magAuto = true; _scale.

Run Dijkstra's Algorithm on a List<Point> in C#

 ̄綄美尐妖づ 提交于 2019-12-23 04:41:26
问题 I have a list of Point types in C#. I want to run Dijkstra's algorithm on this list of points where the first entry in the list is the starting location. Is there a way of doing this using an existing library? If such library doesn't exist, is there a way of calculating the distance between two points with x and y coordinates. For example, calculate the distance between point A (x coordinate =2, y coordinate = 4) and point B ((x coordinate =9, y coordinate = 7). I have used the ZedGraph

ZedGraph vertical lines with LineObj issue

家住魔仙堡 提交于 2019-12-22 05:49:30
问题 I have a ZedGraphControl with a few curves in it and I want to add vertical lines at some fixed x-positions. The lines should of course only be inside the actual graph area. I tried following LineObj line = new LineObj(Color.Black, xPos, myPane.YAxis.Scale.Min, xPos, myPane.YAxis.Scale.Max); line.Line.Style = System.Drawing.Drawing2D.DashStyle.Dash; line.Line.Width = 1f; myPane.GraphObjList.Add(line); and this works fine until the user zooms the graph, the vertical lines will then stretch out

ZedGraph custom graph

情到浓时终转凉″ 提交于 2019-12-22 05:18:24
问题 I want to make wtih ZedGraph following dynamically chart: How to make ZedGraph axes reverse and and time axis? Thanks UPD 1 : I have to try with following code: GraphPane myPane = zg1.GraphPane; myPane.YAxis.Type = AxisType.Date; myPane.YAxis.Scale.MajorUnit = DateUnit.Minute; myPane.YAxis.Scale.MinorUnit = DateUnit.Second; myPane.XAxis.IsVisible = false; myPane.X2Axis.IsVisible = true; myPane.X2Axis.MajorGrid.IsVisible = true; myPane.X2Axis.Scale.Min = 0; myPane.X2Axis.Scale.Max = 600;

Zedgraph - how to customize date based X-Axis tics

a 夏天 提交于 2019-12-22 05:03:32
问题 SITUATION I am building a chart using ZedGraph of price (Y axis) against time (X axis). The duration of time is three years. At the moment I'm getting X axis labels of : Jan 11; Jan 12; Jan 13 for a set of data that runs from 3-Mar-2010 to 2-Mar-2013. As far as I can see this is default behaviour if the axis is of type DateTime. QUESTION How do I change the X axis labelling so that I get: Mar 11; Mar 12; Mar 13 ? And more generally so that I can change the labels used to coincide with the

Plotting data with gaps in ZedGraph using nullable types / null values

…衆ロ難τιáo~ 提交于 2019-12-13 17:53:14
问题 This question is very similar: How to miss points in a zedgraph line graph in c. I am pulling data from SQL and plotting it using ZedGraph, but I am using nullable types ( int? , float? etc.) and would like to create gaps in the plot wherever a null value exists. Is there a way to have ZedGraph handle these null values, or do I need to convert them all to double.NaN ? 回答1: Casting nullable types to double.NaN seems like the only option when creating the PointPairList for a ZedGraph LineItem

IsAntiAlias creates border around graph

泪湿孤枕 提交于 2019-12-13 15:43:21
问题 Here's screenshot of my form with a Zedgraph: It's how I want it: grey graph on a grey form; no graph or chart borders. The only problem is the aliasing. So I add this: zedGraphControl1.IsAntiAlias = true; but then I get this: How can I get rid of that partial border on the top and left of the graph that now appears? 回答1: zedgraphControl1.MasterPane.Border.IsVisible = false; Should fix it. 回答2: i dug around the zedgraph source; couldn't find any easy cause/fix. so, i just turned off

Make dynamically number of tab pages with ZedGraph in WinForm C#

╄→гoц情女王★ 提交于 2019-12-13 03:59:28
问题 I have data for several days. I want to plot that data, one day in one tab page. The tab page can change dynamically corresponding with the number of the day. Previously, I always make a static page in the design mode. I use ZedGraph control to plot the data. I decided how many pages that I need. Then it means the number of pages is static. Now, I need more dynamically. I want the number of tab pages can change dynamically. Each page has similar controls inside it. How to do that? I have no

ZedGraph - Adding threshold line

六眼飞鱼酱① 提交于 2019-12-13 01:28:14
问题 This may be simple, but I'm unable to figure it out. I have a linear graph for each of the OS performance counters (Y->value, x->Time). Now I want to add a straight horizontal line for a threshold Y value in, say, Red so that it shows in the graph along with the actual data. I already know the threshold value for each of my counters. How do I do this? I currently do this to show a perfcounter in its own tabPage: Cursor = Cursors.WaitCursor; var perfCounter = PerfDictValues.Value.First(pc =>

How to find the index position on ZedGraph

允我心安 提交于 2019-12-12 12:08:50
问题 Is there any ways around to find the index position of a curve, based on the current xPosition, let's say I have a curve Item - MyCurve, which has 20k points and when the mouse moves I could get the mouse location & then I could get the x & y positions by simply using the following function. double xPos=0, yPos=0; this.zedGraphControl1.GraphPane.ReverseTransform(MouseLoc, out xPos, out yPos); but I want to find the data points from the curve item, any suggestions...? Thanks in advance....:)