Software FX Community

# bubble scaling problem

## Recommended Posts

When plotting a bubble chart with automatic axis scaling (for both x- and y-axis) it seems that the calculated value for the axis.max is the center of the outermost bubble, not taking into account the diameter of the bubble. the topmost and rightmost bubble(s) are cut in half.

Sorry to say, but this doesn't look good. One would expect that automatic scaling takes the bubble diameter into account. I don't want to switch to manual scaling because I don't know in advance what the range is for the data the chart is fed with, and I don't want to program complex calculations to make corrections for the bubble diameter. I'd expect the control to solve this problem.

Is there any chance for a quick fix?

Example code:

Dim i As Long

Dim j As Long

Dim ns As Long

Dim np As Long

Dim v As Long

ns = 3

np = 3

v = 1

With Chart1

.OpenData COD_Values, ns * 2, np

.OpenData COD_XValues, ns, np

For i = 0 To (ns * 2) - 1 Step 2

.Series(i + 1).YAxis = YAxis_Secondary

.AxisY2.Visible = False

For j = 0 To np - 1

.Value(i, j) = v

.Value(i + 1, j) = v

.XValue(i, j) = v

v = v + 1

Next j

Next i

.CloseData COD_XValues

.CloseData COD_Values

.Gallery = Gallery_Bubble

End With

##### Share on other sites

Neoteny,

This behavior is by design and it is well explained in Chart FX Internet 6.2 Resource Center manual. To fix the Max value for X and Y Axes I recommend you to use the following code:

Chart1.AxisY.Max = Chart1.AxisY.Max + 0.5<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Chart1.AxisX.Max = Chart1.AxisX.Max + 0.5

##### Share on other sites
• 3 weeks later...

Mmm, you make it sound so easy, just add zero point five to fix the problem. I thought I pointed out that the chart needs to work with numbers (for x-y and bubble size) that I don't know beforehand. To complicate things, I don't know the number of series and points the chart needs to display either. To find a correction algorithm took us almost a week, the information provided in some posts in the forum (including an algorithm used in an older version of the chart control) and in the resource centre wasn't of much help.

My point is, that one would (should?) expect the chartfx control to come with a 'best guess' for the bubble chart so -under normal circumstances- one wouldn't have to resort to 'tweaking'. Of course what's best is always a matter of opinion. One can argue that setting the max of the chart to the center of the outermost bubble is decent default behaviour (though everyone of our customers thinks differently and expects the chart to dsiplay the whole bubble), but I was stunned to discover that two charts with (say) 6 bubbles can display with different bubble sizes, because one chart contains 2 series with 3 points each and the other contains 1 series with 6 points. I can't find any rationale for that behaviour (and it further complicated finding a decent algorithm).

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.