The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Pie chart inside bubble?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
JordiPlana Posted - 12/22/2016 : 03:27:03 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2016 (64-bit) b9.3.226
Operating System: Windows 10

Hi. I would like to know if this is possible: I have a ternary plot with bubbles. Is it possible to make the inside of the bubble a pie chart?

Thanks in advance.
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 12/22/2016 : 2:48:35 PM
Hi JordiPlana,

I'm sorry for that the following is a possible procedure not for ternary, but for the Cartesian system
1) Book1 for Bubble Data (XYY) with N (say 3) rows. Add extra 3 columns (D, E, F)
2) Book2 for Pie Data with N columns.
3) Create Bubble chart from Book1 (Graph1)
4) Create Pie charts from columns in Book2 in order (Graph2, .., Graph4)
  Note: Remove surrounding box by turning OFF check boxes of XAxes, YAxes, and Labels 
    in Show Elements in Display tab for Layer1.
5) ALT+Click every Pie chart (in order) to select the layer frame, copy-and-paste it into the bubble chart
  Note: To view the pasted the Pie charts easily, you can zoom out the displayed page Zoom, say to 50%, setting in Standard toolbar.
6) Run the following script:

/////////////////////////////////
PieSizeFactor=1.7;
bk$="Book1";   //Book name of bubble data
gr$$="Graph1"; //Graph name of bubble chart

NP=bk$!wks.maxrows;  //number pf Pies
%(bk$)_D=100*(%(bk$)_A-%(gr$)!layer1.x.from)/layer1ScaleWidth;
%(bk$)_E=100*(%(bk$)_B-%(gr$)!layer1.y.from)/layer1ScaleHeight;
sum(%(bk$)_C);
%(bk$)_F=%(bk$)_C/sum.total;
layer1HalfWidth=%(gr$)!layer1.width/2;
layer1HalfHeight=%(gr$)!layer1.height/2;
layer1ScaleWidth=%(gr$)!layer1.x.to-%(gr$)!layer1.x.from;
layer1ScaleHeight=%(gr$)!layer1.y.to-%(gr$)!layer1.y.from;
for(ii=1; ii<=NP; ii++) {
  gr$!layer$(ii+1).link=1;
  gr$!layer$(ii+1).unit=7;
  layer2HalfWidth =gr$!layer$(ii+1).width/2;
  layer2HalfHeight=gr$!layer$(ii+1).height/2;
  gr$!layer$(ii+1).left=%(bk$)_D[ii]-layer2HalfWidth;
  gr$!layer$(ii+1).top=100-%(bk$)_E[ii]-layer2HalfHeight;
}
for(ii=1; ii<=NP; ii++) {
  gr$!layer$(ii+1).width=50*%(bk$)_F[ii]*PieSizeFactor;
  gr$!layer$(ii+1).height=50*%(bk$)_F[ii]*PieSizeFactor;
}
for(ii=1; ii<=NP; ii++) {
  layer2HalfWidth=%(gr$)!layer$(ii+1).width/2;
  layer2HalfHeight=%(gr$)!layer$(ii+1).height/2;
  gr$!layer$(ii+1).left=%(bk$)_D[ii]-layer2HalfWidth;
  gr$!layer$(ii+1).top=100-%(bk$)_E[ii]-layer2HalfHeight;
}
Type -b Job done.
////////////////////////////////////

7) If the Pies are not scales nicely, change PieSizeFacto in the code, and run again. Repeat until it looks okay.



I will try to modify this code for ternary later, but as the holiday season arrives tomorrow, it may take time.
If you are in a hurry, try to modify by yourself... sorry!
Anyway happy holidays!

--Hideo Fujii
OriginLab

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000