gpt4 book ai didi

c# - 带有大小参数的不成比例的气泡图

转载 作者:行者123 更新时间:2023-11-30 21:54:00 24 4
gpt4 key购买 nike

我创建了一个气泡图,并输入了一些测试值,如下所示:

    this.chart1.Series["blueBubble"].Points.AddXY(2, 3, 6);
this.chart1.Series["redBubble"].Points.AddXY(1, 0, 7);
this.chart1.Series["yellowBubble"].Points.AddXY(1, 3, 8);

当我将特定气泡的大小输入到 AddXY 函数的第三个参数时,大小调整是以完全错误的比例表示法完成的。看图:

enter image description here

如何将气泡大小更改为正确的命题表示形式?

最佳答案

这看起来很奇怪。

我的最佳解释是尺寸总是从最小的一组开始,然后按比例从 1 到最大的一组。

听起来很奇怪?是的。

这里是MSDN上关于BubbleScaleMaxBubbleScaleMin的注释

If set to Auto, the smallest plotted bubble is displayed using the minimum size.

If set to Auto, the largest plotted bubble will be displayed using the maximum size.

将这些属性设置为除 Auto 之外的任何其他值是很棘手的;你可以使用这个:

 chart1.Series[0]["BubbleScaleMin"] = "0";

或任何小于最小尺寸的数字。

或者,如果您愿意,这里有一个解决方法:添加一个大小为 0 且具有合适的 x 和 y 值的透明虚拟点:

int i = this.chart1.Series[0].Points.AddXY(1, 1, 0);
this.chart1.Series[0].Points[i].Color = Color.Transparent;

之前和之后:

enter image description here enter image description here

关于c# - 带有大小参数的不成比例的气泡图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33556748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com