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