Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Tordur · Mar 05, 2012 at 03:00 PM · graphicsdraw

Pie graph with more than 2 different variables?

Hello, I'm trying to create a pie graph, with 3 different variables. I'm having a hard time figuring out how i would go about and do that. I'm trying to get it to work by lets say we have 3 variables, and all their values are 50. Then the circle in total would have 150, which then makes each part of the pie 33,3%. But what I want to do, let's say i add another 50 to just one of the variables, then in total i would have 200, but two variables only make up for 25% but the last variable makes up 50% of the circle. Is it possible to even create it? Edit: I'm not asking how to turn the numbers in to percents. But what technique I can use for drawing a Pie graph with more than just 2 different wedges.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Owen-Reynolds · Mar 05, 2012 at 06:26 PM 0
Share

Are you asking how to turn any three numbers into percents? Or are you asking what technique you could use to draw a three-color pie chart with any size wedges?

What technique are you using for a two-color (the overlapping 1/2-circle trick?) How have you tried to adapt that?

avatar image Tordur · Mar 05, 2012 at 06:47 PM 0
Share

I mean the technique to draw a three-color pie chart. I've already looked at http://answers.unity3d.com/questions/14770/creating-a-circular-progressbar-timer.html Which I couldnt think of a way to implement. Or in a way so that it will work with more than just 2 wedges. (I'll just edit it so it's clear what i mean.)

avatar image DaveA · Mar 05, 2012 at 10:21 PM 0
Share

Unity doesn't have like graphing and drawing API's hooked up, so are you wanting to do this in a GUI texture or 3D object?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · Mar 05, 2012 at 10:26 PM

If I understand you correctly, you just want to draw a 3-wedge pie graph. If you have Pro, look into using the GL glass. Otherwise, you may need to construct wedge meshes on-the-fly. If you're values are fairly quantized (like in increments of 10) you could pre-render them and then just pull up the image of the corresponding chart, but I wouldn't want to go down that path.

Look in the Scripting Reference at the Mesh class. You'll probably want to use high-school trig to figure out the pie vertices.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tordur · Mar 06, 2012 at 10:15 AM 0
Share

I've thinked about the $$anonymous$$esh class, (I don't have pro :P)I have no idea how I should build the mesh. I'm lucky that I'm learning trigonometry in school right now, so its a good way for me to learn it.

avatar image Owen-Reynolds · Mar 07, 2012 at 05:01 PM 0
Share

Unity Free lets you create meshes. The math is just simple sin/cosin stuff. But, you will want to be comfortable with using arrays.

But, that 1st link you posted seems like it would work for any number of pie slices (that is, once you got it for two, it should be simple to add a 3rd, 4th... .)

avatar image
0

Answer by Uchiha Itachi · Mar 28, 2014 at 03:37 AM

Sounds not an easy problem. I am recently also during some studies on the UI chart component, which has the UI pie graph inside, it sounds convenient in using, it would be quite fine if it can be applied in Unity.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a way to render a SkinnedMesh a second time with another material in a frame? 0 Answers

Getting Error "DrawGUITexture: Texture is Null" when using Graphics.DrawTexture in OnGUI() 2 Answers

Graphics.Blit or texture update how long to draw to entire screen? 0 Answers

How to call Graphics.DrawTexture() in Update 1 Answer

How to draw a Sprite on OnDrawGizmos() 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges