iOS pie chart properties












0















I´m using Charts for iOS and have a pie chart. I would like to remove the inner circle and change the width for each pie inside the pie chart. I have not been able to find how to decrease the width for the pie chart and remove the inner circle.



The image is what I want to do.



Chart



I have tried on my PieChartView to change the draw properties but have not succeeded. Any ideas how to solve this?










share|improve this question





























    0















    I´m using Charts for iOS and have a pie chart. I would like to remove the inner circle and change the width for each pie inside the pie chart. I have not been able to find how to decrease the width for the pie chart and remove the inner circle.



    The image is what I want to do.



    Chart



    I have tried on my PieChartView to change the draw properties but have not succeeded. Any ideas how to solve this?










    share|improve this question



























      0












      0








      0


      1






      I´m using Charts for iOS and have a pie chart. I would like to remove the inner circle and change the width for each pie inside the pie chart. I have not been able to find how to decrease the width for the pie chart and remove the inner circle.



      The image is what I want to do.



      Chart



      I have tried on my PieChartView to change the draw properties but have not succeeded. Any ideas how to solve this?










      share|improve this question
















      I´m using Charts for iOS and have a pie chart. I would like to remove the inner circle and change the width for each pie inside the pie chart. I have not been able to find how to decrease the width for the pie chart and remove the inner circle.



      The image is what I want to do.



      Chart



      I have tried on my PieChartView to change the draw properties but have not succeeded. Any ideas how to solve this?







      swift ios-charts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 '18 at 16:34









      kit

      1,1063716




      1,1063716










      asked Oct 22 '16 at 8:42









      John DoeJohn Doe

      11




      11
























          2 Answers
          2






          active

          oldest

          votes


















          3














          PieChartView has the following properties:




          1. holeRadiusPercent

          2. transparentCircleRadiusPercent


          Set them both to 0.0 and you should achieve what you want.



          You can also hide the hole explicitly by setting chartView.drawHoleEnabled = false



          If you need more properties, just open the source code. It is heavily commented.






          share|improve this answer

































            1














            Adding to @sulthan's response with some example code.



            The CGSize of the chart view's frame can be modified to affect the chart width itself.



            However, a CGSize which exceeds the CGSize of the chart's parent view may result in unpredictable layouts.



            let chart = PieChartView( frame: self.view.frame)
            // setup data...etc.

            // style
            chart.holeRadiusPercent = 0
            chart.transparentCircleColor = UIColor.clear

            // increase width
            // width in excess of the parentView.size.width will cause layout issues
            chart.frame.size = CGSize(width: 500, height: chart.frame.size.height)


            Shameless plug: Learn more about iOS Pie charts at ioscharts.io/piechart



            enter image description here






            share|improve this answer
























            • The website was very helpful!

              – Aditya Garg
              Dec 10 '16 at 6:58











            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%2f40190089%2fios-pie-chart-properties%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            PieChartView has the following properties:




            1. holeRadiusPercent

            2. transparentCircleRadiusPercent


            Set them both to 0.0 and you should achieve what you want.



            You can also hide the hole explicitly by setting chartView.drawHoleEnabled = false



            If you need more properties, just open the source code. It is heavily commented.






            share|improve this answer






























              3














              PieChartView has the following properties:




              1. holeRadiusPercent

              2. transparentCircleRadiusPercent


              Set them both to 0.0 and you should achieve what you want.



              You can also hide the hole explicitly by setting chartView.drawHoleEnabled = false



              If you need more properties, just open the source code. It is heavily commented.






              share|improve this answer




























                3












                3








                3







                PieChartView has the following properties:




                1. holeRadiusPercent

                2. transparentCircleRadiusPercent


                Set them both to 0.0 and you should achieve what you want.



                You can also hide the hole explicitly by setting chartView.drawHoleEnabled = false



                If you need more properties, just open the source code. It is heavily commented.






                share|improve this answer















                PieChartView has the following properties:




                1. holeRadiusPercent

                2. transparentCircleRadiusPercent


                Set them both to 0.0 and you should achieve what you want.



                You can also hide the hole explicitly by setting chartView.drawHoleEnabled = false



                If you need more properties, just open the source code. It is heavily commented.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 12 '18 at 14:41

























                answered Oct 22 '16 at 13:52









                SulthanSulthan

                94.8k16154197




                94.8k16154197

























                    1














                    Adding to @sulthan's response with some example code.



                    The CGSize of the chart view's frame can be modified to affect the chart width itself.



                    However, a CGSize which exceeds the CGSize of the chart's parent view may result in unpredictable layouts.



                    let chart = PieChartView( frame: self.view.frame)
                    // setup data...etc.

                    // style
                    chart.holeRadiusPercent = 0
                    chart.transparentCircleColor = UIColor.clear

                    // increase width
                    // width in excess of the parentView.size.width will cause layout issues
                    chart.frame.size = CGSize(width: 500, height: chart.frame.size.height)


                    Shameless plug: Learn more about iOS Pie charts at ioscharts.io/piechart



                    enter image description here






                    share|improve this answer
























                    • The website was very helpful!

                      – Aditya Garg
                      Dec 10 '16 at 6:58
















                    1














                    Adding to @sulthan's response with some example code.



                    The CGSize of the chart view's frame can be modified to affect the chart width itself.



                    However, a CGSize which exceeds the CGSize of the chart's parent view may result in unpredictable layouts.



                    let chart = PieChartView( frame: self.view.frame)
                    // setup data...etc.

                    // style
                    chart.holeRadiusPercent = 0
                    chart.transparentCircleColor = UIColor.clear

                    // increase width
                    // width in excess of the parentView.size.width will cause layout issues
                    chart.frame.size = CGSize(width: 500, height: chart.frame.size.height)


                    Shameless plug: Learn more about iOS Pie charts at ioscharts.io/piechart



                    enter image description here






                    share|improve this answer
























                    • The website was very helpful!

                      – Aditya Garg
                      Dec 10 '16 at 6:58














                    1












                    1








                    1







                    Adding to @sulthan's response with some example code.



                    The CGSize of the chart view's frame can be modified to affect the chart width itself.



                    However, a CGSize which exceeds the CGSize of the chart's parent view may result in unpredictable layouts.



                    let chart = PieChartView( frame: self.view.frame)
                    // setup data...etc.

                    // style
                    chart.holeRadiusPercent = 0
                    chart.transparentCircleColor = UIColor.clear

                    // increase width
                    // width in excess of the parentView.size.width will cause layout issues
                    chart.frame.size = CGSize(width: 500, height: chart.frame.size.height)


                    Shameless plug: Learn more about iOS Pie charts at ioscharts.io/piechart



                    enter image description here






                    share|improve this answer













                    Adding to @sulthan's response with some example code.



                    The CGSize of the chart view's frame can be modified to affect the chart width itself.



                    However, a CGSize which exceeds the CGSize of the chart's parent view may result in unpredictable layouts.



                    let chart = PieChartView( frame: self.view.frame)
                    // setup data...etc.

                    // style
                    chart.holeRadiusPercent = 0
                    chart.transparentCircleColor = UIColor.clear

                    // increase width
                    // width in excess of the parentView.size.width will cause layout issues
                    chart.frame.size = CGSize(width: 500, height: chart.frame.size.height)


                    Shameless plug: Learn more about iOS Pie charts at ioscharts.io/piechart



                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 3 '16 at 23:12









                    AlexAlex

                    250315




                    250315













                    • The website was very helpful!

                      – Aditya Garg
                      Dec 10 '16 at 6:58



















                    • The website was very helpful!

                      – Aditya Garg
                      Dec 10 '16 at 6:58

















                    The website was very helpful!

                    – Aditya Garg
                    Dec 10 '16 at 6:58





                    The website was very helpful!

                    – Aditya Garg
                    Dec 10 '16 at 6:58


















                    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%2f40190089%2fios-pie-chart-properties%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

                    Full-time equivalent

                    Bicuculline

                    さくらももこ