In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to draw a pie chart on the TE map, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
How to draw a pie chart on TE, you need to call several API interfaces developed by TE and some simple mathematical algorithms. The results are as follows:
The specific implementation ideas are as follows:
The angle of a circle is 360 degrees. First, calculate the number of objects in the pie chart, the angle occupied by each object, set the radius of the outer circle of the pie chart, and the position of the center of the outer circle.
According to each angle and radius, the moving distance in east-west direction and north-south direction is obtained. The functions used are radius * sin and radius * cos. According to the moving distance and center point, sgworld.CoordServices.MoveCoord function is used. For specific parameters, see API help to obtain a new arc coordinate point. In the same way, the arc coordinate point of the end point is obtained, and the center point is connected with two newly obtained points to get a triangle. In order to make the arc look smooth, you need to make a difference point in the middle, and then connect all the points together, which is a piece of the pie chart.
The abbreviated code indicates:
/ / acquisition of distance between two directions
Double dushu = jiaodu + 360 * yi1 / sum
Double sin = Math.Sin (dushu * Math.PI/180)
Double cos = Math.Cos (dushu * Math.PI / 180)
Double eastwest = radius * cos
Double southnorth = radius * sin
/ / move in the direction of coordinates
Int chazhi = Convert.ToInt32 ((dushu-jiaodu) / 2)
ICoord2D move = sgworld.CoordServices.MoveCoord (yuanxi.X, yuanxi.Y, eastwest, southnorth)
/ / difference
For (int j = 1; j < chazhi; jacks +)
{
Double sinint = Math.Sin ((jiaodu + j * 2) * Math.PI / 180)
Double cosint = Math.Cos ((jiaodu + j * 2) * Math.PI / 180)
Double eastwestint = radius * cosint
Double southnorthint = radius * sinint
ICoord2D moveint = sgworld.CoordServices.MoveCoord (yuanxi.X, yuanxi.Y, eastwestint, southnorthint)
Polygon + = "," + moveint.X.ToString () + "" + moveint.Y.ToString ()
}
/ / create a polygon
IGeometry igeometry = sgworld.Creator.GeometryCreator.CreateGeometryFromWKT (polygon)
ITerrainPolygon6 ipolygon = sgworld.Creator.CreatePolygon (igeometry, color1,color1,AltitudeTypeCode.ATC_ON_TERRAIN,group); / / join several points into polygons.
The above is all the contents of the article "how to draw a pie chart on a TE map". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.