Add labels at the end of UIProgressView bars










0















I am able to get a view with horizontal bar chart with per with the help of UIProgressBar in a UITableView,



Current Output



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



Desired Output



How can we add the progress percentage label at the end of the progress bars like this?










share|improve this question
























  • 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















0















I am able to get a view with horizontal bar chart with per with the help of UIProgressBar in a UITableView,



Current Output



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



Desired Output



How can we add the progress percentage label at the end of the progress bars like this?










share|improve this question
























  • 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













0












0








0


1






I am able to get a view with horizontal bar chart with per with the help of UIProgressBar in a UITableView,



Current Output



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



Desired Output



How can we add the progress percentage label at the end of the progress bars like this?










share|improve this question
















I am able to get a view with horizontal bar chart with per with the help of UIProgressBar in a UITableView,



Current Output



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



Desired Output



How can we add the progress percentage label at the end of the progress bars like this?







ios swift uiprogressview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo