The younger brother in to write a program that related to GIS, using the teechart controls, but never contact the control; After will now display in a map series SHP image, but also need to add a lot of points on the map, the problem is the Point in the c # types support only int parameter, can not directly use the latitude and longitude, so I want to consult everybody, how to use it in the teechart to double as a parameter of the Point type? Because it is a new version of the plugin, so seems to be no such thing as addxy method are available,
Ps: the System's own PointF does not meet the accuracy requirement, need to use a double
CodePudding user response:
The answer is simple
original
Using two list
Respectively read x, y value (corresponding), then the series. The add (list1. Toarray (), listy. Toarray ()) CodePudding user response:
The original poster can't? CodePudding user response:
refer to the second floor qq_34798533 response: the original poster can't? . Send it for you CodePudding user response:
Someone direct messages to ask me that question, is also a novice, I'll stick your own code part here Public Map sreMap=new Map (); Public Points sreLowerPoints=new Points (); Enclosing tChart. Series. The Add (sreLowerPoints); Int intMost=10000; If (dtblExcel. Rows. Count & gt; IntMost) { MessageBox. Show (" before the points too much, just add "+ intMost +" a "); } The else { IntMost=dtblExcel. Rows. Count; } List ListPointX=new List (a); List ListPointY=new List (a); for (int i=0; i { ListPointX. Add ((double) dtblExcel. Rows [I] [0]). ListPointY. Add ((double) dtblExcel. Rows [I] [1]). } SreLowerPoints. Add (listPointX. ToArray (), listPointY. ToArray ()); In fact, through the series [n] see, I know this kind of data structure is seriesXYPoint, is in the namespace steema tchart. Data in a data type; In addition, the series. The add has 53 types of overloading, there are many other flexible way to add data, compared with an earlier version of teechart addXY or addArray added more flexibility CodePudding user response:
The original poster can't? CodePudding user response:
Thank you very much for the teacher, so quick reply, I'm still not quite understand, this is increased can use double sreLowerPoints, So how to hang the map hook? Is the map is generated by such a data point? I was a novice, don't quite understand CodePudding user response:
refer to 6th floor iloveyou6668882003 response: thank you very much for the teacher, so quick reply, I'm still not quite understand, this is increased can use double sreLowerPoints, So how to hang the map hook? Is the map is generated by such a data point? I was a novice, don't quite understand? You refer to write it is understood that different series will be shown in the image, because the cause of the project, I still have a higherSeries besides lowerSeries, a total of three series stacked together; TChart. Chart. The Add (Serie) the longer, the more in this Serie shows above, So relative to a piece of code that is what I call the content in the "lower" will actually block the content on the map, no change name, don't want to mislead you CodePudding user response:
refer to 6th floor iloveyou6668882003 response: thank you very much for the teacher, so quick reply, I'm still not quite understand, this is increased can use double sreLowerPoints, So how to hang the map hook? Is the map is generated by such a data point? I was a novice, don't quite understand? As to map the serie, I used to import the Shp file, Steem. TeeChart. Has support for the Shp file types in the Data space TeeShp, through its loadmap method to load the file content directly to the map on this serie, Teechart, moreover, there is a place to do not so good, the loadmap automatically in the choice of SHP file of the same directory to find the same SHX files, if not will produce abnormal, So if you want to use other ways to use the map type serie, I can't help you ~ CodePudding user response:
I just want to add some points, form an area map, but the use of the map. The add (), increase in multiple points to an array, is don't show, very depressed, CodePudding user response:
The Map Map=new Map (); TChart1. Series. The Add (map); List LDX=new List (a); List Ldy=new List (a); List LDZ=new List (a); LDX. Add (50); LDX. Add (20); LDX. Add (15); LDX. Add (30); LDX. Add (11); Ldy. Add (215); Ldy. Add (400); Ldy. Add (10); Ldy. Add (10); The map. The Add (LDX. ToArray (), ldy. ToArray ()); This is how I increased, but just don't show map area, CodePudding user response:
The references to the tenth floor iloveyou6668882003 response: The Map Map=new Map (); TChart1. Series. The Add (map); List LDX=new List (a); List Ldy=new List (a); List LDZ=new List (a); LDX. Add (50); LDX. Add (20); LDX. Add (15); LDX. Add (30); LDX. Add (11); Ldy. Add (215); Ldy. Add (400); Ldy. Add (10); Ldy. Add (10); The map. The Add (LDX. ToArray (), ldy. ToArray ()); This is how I increased, but just don't show map area, In order to answer your question, I go to read the source code, TeeSHP summarize so to write: Double [] dbX=new double [] {0, 0, 1, 1, 0}; Double [] dbY=new double [] {0, 1, 1, 0, 0}; The Map map1=new Map (tChart. Chart); SreMap. Add (0, 0, ""); Polygon pgon=sreMap. Shapes [0]; Pgon. Points. BeginUpdate (); for(int i=0; i { Pgon. Add (dbX [I], dbY [I]); } Pgon. Points. EndUpdate (); CodePudding user response:
Thank you very much for your so keen, at first still doesn't work, after an afternoon of experiments lookup, Polygon pgon=new Polygon (sreMap. Shapes, tChart1. Chart); This sentence to this, with respect to OK, it's really a difficult dead people, hope I encounter this problem, see the article can be solved, CodePudding user response:
How can I add Teechart control in c # 2015?