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.
 

Jon Peltier

MrExcel MVP
Joined
May 14, 2003
Messages
4,730
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?
 

Forum statistics

Threads
1,082,444
Messages
5,365,560
Members
400,838
Latest member
Renedescartes

Some videos you may like

This Week's Hot Topics

Top