Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Create Pie Chart

    Hi, I want to create a pie chart in the same way like in the link below

    https://imaa-institute.org/m-and-a-by-industries/

    Kindly help how to do this.

    My data is Like this,


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str30 AcquirorMacroIndustry double Percent
    "Industrials"                    20.28
    "Materials"                      13.42
    "Consumer Products and Services" 13.22
    "High Technology"                 9.84
    "Healthcare"                      8.55
    "Financials"                      8.05
    "Media and Entertainment"         6.96
    "Consumer Staples"                5.17
    "Energy and Power"                4.77
    "Real Estate"                     4.37
    "Telecommunications"              3.28
    "Retail"                          2.09
    ""                                   .
    end

  • #2
    Don't, unless someone is paying you or ordering you to do this. A horizontal bar chart will be much clearer.

    Code:
    set scheme s1color
    graph hbar (asis) Percent, over(Acq, sort(1) descending) bar(1, blcolor(green) bfcolor(eltgreen*0.2)) ///
    subtitle(Percent, place(w)) name(Aamir)
    Click image for larger version

Name:	Aamir.png
Views:	1
Size:	34.8 KB
ID:	1492210




    If you're compelled to go pie, then


    Code:
    graph pie Percent, over(Acq) sort(Percent) descending subtitle(Percent, place(w))
    is a start, but still so awful that I won't show it here. See if you can produce anything so clear as the display above.


    Last edited by Nick Cox; 07 Apr 2019, 07:43.

    Comment


    • #3
      Its pretty good. Thanks Nick.

      Comment


      • #4
        Dear Nick, How to bring the resulted bar chart on word. Kindly guide. Thanks

        Comment


        • #5
          Its OK. I got it. Thanks

          Comment

          Working...
          X