Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4596568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:07:59+00:00 2026-05-21T23:07:59+00:00

I want to create a bar chart diagram. I already have a diagram component,

  • 0

I want to create a bar chart diagram. I already have a diagram component, I just need to adapt it to a bar chart. When touching one of the bars, the value shold pop up in small view.

As I can see there are several different strategies that can be applied here. What I want to know is which strategy should I use? Any of these or perhaps there are other better ideas?:

  1. Bar is a UIButton.
  2. Bar is a touch enabled UIImage.
  3. Bar is a UIView.
  4. Bar is just painted graphics and I have to transcode the touched coordinates and make some calculations in order to know what bar was touched. I don’t don’t believe in this strategy but perhaps there are reasons to rethink this that you can provide for me…

I assume that a UILable is the way to present the data associated with the bar?

Thanks in advance for your advice!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:08:00+00:00Added an answer on May 21, 2026 at 11:08 pm

    In my humble opinion, and having written many bar charts (and other charts)… #4 is actually the correct choice for performance and my personal preference. Creating the virtual graph in memory to map touches to bars is not difficult at all, as you are simply storing rectangles in arrays and checking to see if points are inside that rect.

     CGRectContainsPoint(CGRect, CGPoint);
    

    Now, having said that, if you want to introduce animations in to your chart, which is pretty cool stuff… then I could create a UIView composed of several UIViews (one for each bar, or bar segment), this way you can animate each bar individually without writing your own animation loop.

    just my two cents.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a chart that consists of couples of two bars. one
I want to create a bar-chart, but extraordinary high values should be shortened. An
I want to create a ColumnSeries Bar Chart in WPF using C#. I shall
I want to create a menu bar identical to the one in windows forms
I have a menu bar and I want to create a div for each
I am trying to create a Stacked Bar Chart. My requirement is I need
I want to create a message bar like the one shown on top of
I want to create a bar chart application in windows based .net application, i
I need to write a method to create a simple text bar chart given
i want to create a scroll bar in my project . I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.