Unproportional Bubble Chart with the size paramater

拟墨画扇 提交于 2019-12-02 02:12:30

问题


I´ve created a bubble chart and I put in some testing values as follow:

    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);

As I put in the size of the particular bubble to the third parameter of AddXY function, the sizing is done in a completely wrong proportional representation. See picture:

How can I change the bubble sizes to the right proposition representation?


回答1:


This looks really weird.

The best explanation I have is that the sizes always start with the smallest one set and scale them going from 1 to the largest one set in proprtional steps.

Sounds awfully strange? Yup.

Here are the notes on MSDN on BubbleScaleMax and BubbleScaleMin

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.

Setting these properties to anything else but Auto is tricky; you could use this:

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

Or any number smaller than your smallest size.

Or, if you prefer, here is a workaround: Add a transparent dummy point with size = 0 and suitable x- and y-values:

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

Before and after:



来源:https://stackoverflow.com/questions/33556748/unproportional-bubble-chart-with-the-size-paramater

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!