Profile Picture

Unable to draw 2D closed shapes

Posted By Fan-Jiang Zeng 8 Years Ago
Rated 1 star based on 1 vote.
Author
Message
Fan-Jiang Zeng
Question Posted 8 Years Ago
View Quick Profile
 
Group: Forum Members
Last Active: 8 Years Ago
Posts: 7, Visits: 17
I want to draw 2D closed shapes (such as a triangle, a circle, etc) with which a single color is filled, but I could not find a suitable class to finish this task after trying all the provided chart types. 
My first attempt is the Line series, but it could not be filled with colors.
My second attempt is the grid/mesh/triangle surface series with DrawFlat set to true, but it didn't work since the thickness of a 2D shape is 0, thus I couldn't see it in the chart.
Finally I tried the shape class, and sadly it only supports limited pre-defined shapes. But I need to draw irregular shapes - with arbitrary outlines.
Are there any suitable classes that can satisfy my requirements? Thank you!

Nevron Support
Posted 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi,

Currently you can achieve this using a custom series - check out the following example - All Examples \ Chart Gallery \ Custom \ Custom Series - using this approach you can render arbitrary shapes. The upcoming 2016.1 release will have a series called graphics path series which allows you to draw any type of shape like a regular series.


Best Regards,
Nevron Support Team



Fan-Jiang Zeng
Posted 8 Years Ago
View Quick Profile
 
Group: Forum Members
Last Active: 8 Years Ago
Posts: 7, Visits: 17
Thank you for your reply, but your solution still cannot solve my problem. I want to draw an irregular closed shape which contains a series of points with known coordinates. With the Graphics Path class I can only draw predefined shapes such as ellipses and rectangles. Do you have other suggestions? Thanks again!

Nevron Support
Posted 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi,
The shape series can draw arbitrary shape - in fact you can draw everything with the shape or custom series as they both support GraphicsPath based rendering. This includes open and closed figures, figures with holes, figures with multiple contours etc. so it is not limited in any way to simple shapes. The following link in MSDN shows the available methods of the graphics path class:

https://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath(v=vs.110).aspx

(in case you want to use the Custom painting functionality). In case you decide to use the shape series you can take a look at the following topic:
http://helpopenvision.nevron.com/#Graphics%20Paths.html

Hope this helps - let us know if you meet any problems or have any questions.





Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic