自定义图表构建器:圆圈与坐标不对齐各位,
我尝试通过自定义图形在图形生成器中绘制一个圆,
可以看到,圆圈与数据点并不对齐。
如何才能做得更好,使圆圈在画布上的位置与数据点的位置完全一致?
为什么对y似乎可以,而对x却不行?还有其他方法可以实现吗?
谢谢,并致以最诚挚的问候,格奥尔格
Georg_0-1789394255151.pngGeorg_0-1789394255151.pngGeorg_0-1789394255151.png
New Table( "Circle Data",
Add Rows( 72 ),
Compress File When Saved( 1 ),
New Script(
"y coord vs. x coord", JSL Quote(Graph Builder(show control panel(0),
Size( 540, 540 ),
Variables( X( :x coord ), Y( :y coord ) ),
Elements( Points( X, Y, Legend( 4 ) ), Smoother( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", FrameBox,
{Add Graphics Script( 2, Description( "" ), Circle( {0, 0}, 1 ) )}
)
)
);
) ,
As String( 1 )
),
New Column( "Degree", Numeric, "Continuous", Formula( Row() * 5 ), Set Display Width( 74 ) ),
New Column( "x coord", Numeric, "Continuous", Formula( Cosine( :Degree * (Pi() / 180) ) ), Set Selected, Set Display Width( 123 ) ),
New Column( "y coord", Numeric, "Continuous", Formula( Sine( :Degree * (Pi() / 180) ) ), Set Display Width( 123 ) )
);
回复:自定义图表生成器:圆圈与坐标不对齐如何画圆?在大约四分之三处讨论了这个问题;您可能需要使用“大小/缩放”->“等距缩放”选项。
回复:自定义图表生成器:圆圈与坐标不对齐将尺寸转换为等距坐标应该可以解决这个问题。
Names Default To Here(1);
dt = New Table( "Circle Data",
Add Rows( 72 ),
Compress File When Saved( 1 ),
New Script(
"y coord vs. x coord", JSL Quote(Graph Builder(show control panel(0),
Size( 540, 540 ),
Variables( X( :x coord ), Y( :y coord ) ),
Elements( Points( X, Y, Legend( 4 ) ), Smoother( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", FrameBox,
{Add Graphics Script( 2, Description( "" ), Circle( {0, 0}, 1 ) )}
)
)
);
) ,
As String( 1 )
),
New Column( "Degree", Numeric, "Continuous", Formula( Row() * 5 ), Set Display Width( 74 ) ),
New Column( "x coord", Numeric, "Continuous", Formula( Cosine( :Degree * (Pi() / 180) ) ), Set Selected, Set Display Width( 123 ) ),
New Column( "y coord", Numeric, "Continuous", Formula( Sine( :Degree * (Pi() / 180) ) ), Set Display Width( 123 ) )
);
gb = dt << Run Script("y coord vs. x coord");
framebox = Report(gb)[FrameBox(1)];
framebox << Size To Isometric;