Add labels at the end of UIProgressView bars
I am able to get a view with horizontal bar chart with per with the help of UIProgressBar
in a UITableView
,
Current Output
//TEST DATA:
arrShareNames = ["Infosys","TCS","Reliance","Wipro"]
arrSharepercent = [30,40,21,10]
if let progressView = self.view.viewWithTag(101) as? UIProgressView
progressView.progress = 0.0
progressView.progress = Float(arrSharepercent[indexPath.row]/100)
progressView.progressViewStyle = UIProgressViewStyle.bar
progressView.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi));
I want to append percentage values next to each of the bars of the graph as follows:
Desired Output
How can we add the progress percentage label at the end of the progress bars like this?
ios swift uiprogressview
add a comment |
I am able to get a view with horizontal bar chart with per with the help of UIProgressBar
in a UITableView
,
Current Output
//TEST DATA:
arrShareNames = ["Infosys","TCS","Reliance","Wipro"]
arrSharepercent = [30,40,21,10]
if let progressView = self.view.viewWithTag(101) as? UIProgressView
progressView.progress = 0.0
progressView.progress = Float(arrSharepercent[indexPath.row]/100)
progressView.progressViewStyle = UIProgressViewStyle.bar
progressView.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi));
I want to append percentage values next to each of the bars of the graph as follows:
Desired Output
How can we add the progress percentage label at the end of the progress bars like this?
ios swift uiprogressview
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55
add a comment |
I am able to get a view with horizontal bar chart with per with the help of UIProgressBar
in a UITableView
,
Current Output
//TEST DATA:
arrShareNames = ["Infosys","TCS","Reliance","Wipro"]
arrSharepercent = [30,40,21,10]
if let progressView = self.view.viewWithTag(101) as? UIProgressView
progressView.progress = 0.0
progressView.progress = Float(arrSharepercent[indexPath.row]/100)
progressView.progressViewStyle = UIProgressViewStyle.bar
progressView.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi));
I want to append percentage values next to each of the bars of the graph as follows:
Desired Output
How can we add the progress percentage label at the end of the progress bars like this?
ios swift uiprogressview
I am able to get a view with horizontal bar chart with per with the help of UIProgressBar
in a UITableView
,
Current Output
//TEST DATA:
arrShareNames = ["Infosys","TCS","Reliance","Wipro"]
arrSharepercent = [30,40,21,10]
if let progressView = self.view.viewWithTag(101) as? UIProgressView
progressView.progress = 0.0
progressView.progress = Float(arrSharepercent[indexPath.row]/100)
progressView.progressViewStyle = UIProgressViewStyle.bar
progressView.transform = CGAffineTransform(rotationAngle: CGFloat(-Double.pi));
I want to append percentage values next to each of the bars of the graph as follows:
Desired Output
How can we add the progress percentage label at the end of the progress bars like this?
ios swift uiprogressview
ios swift uiprogressview
edited Nov 13 '18 at 9:24
Sateesh
2,0371718
2,0371718
asked Nov 13 '18 at 8:48
iOS DeveloperiOS Developer
17
17
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55
add a comment |
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277051%2fadd-labels-at-the-end-of-uiprogressview-bars%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277051%2fadd-labels-at-the-end-of-uiprogressview-bars%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You should use some bar chart library instead.
– jack jay
Nov 13 '18 at 8:49
@jack jay, I tried using Charts library by Daniel Gindi, I couldn't make the axis move to the centre and adjust the labels as per the design above, hence decided to use UIProgressBar. It's just the way I wanted now, only the labels are missing. I am hoping to achieve this without the help of a third party library, any help/tips will be greatly appreciated.
– iOS Developer
Nov 13 '18 at 11:32
If you have made it with XIB, then place a label against your progress bar and set horizontal spacing from its trailing to progress bars leading.
– jack jay
Nov 13 '18 at 12:06
@jack jay, Thanks for the reply, although this solution won't work for me since all the progress bars have same width on the XIB i.e the red part is the progress and there is unseen progress bar with clear color is present and the labels will be displayed after the entire progress bar which will not be as per the desired design, I need to display the labels next to the highlighted red progress so that it will look like the desired output. I need a way for displaying the labels immediately next to the red progress bar when it ends, and not at the end of each progress bar.
– iOS Developer
Nov 13 '18 at 12:55