How to draw a rectangle to scale on an excel chart

carlislet

New Member
Joined
Jul 25, 2011
Messages
2
First time post - please be gentle.

I have responsibility for a VB6 program (and Excel 2007) that creates an excel stacked column chart that shows defects for a mile range. The mile range can be continuous oe noncontinuous and can have odd mile post numbers (like 6.28) out of the blue. The program is currently showing projects across the mile range as a horizontal rectangle that SHOULD start at the first milepost and end at the last milepost for the project but is not.

For example, if the project is from mile post 56 to 75, the rectangle shows as starting at 46 and continuing to 63.

I'm pretty sure that the problem lies in how the program calculates the units between the mileposts but don't know of a better way to do it. Currently, I use

lUnit = (Charts(Charts.Count).PlotArea.Width) / (lNoOfMiles)

Is there a better, more accurate value? I tried .MajorUnit but VB6 doesn't recognize it.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I don't mean the workbook. How about data which is typical of what you encounter. And describe this rectangle. Where is its top, bottom, left, and right edges?
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top