![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have an Access report with simple bar graphs that chart percent values between 0 and 100. No problem there, I just use the following line of code to size the dark rectangle (recPercentBar) on top of a lighter colored rectangle (rec100Bar) depending on the value of a double variable (dblValue): Me!recPercentBar.Width = CInt(Me!rec100Bar.Width * (dblValue / 100)) Here's where the problem comes in: I now have a need for a similar bar graph but this time the values run from -20 to 20 with 0 in the center, like this: ---------------------------------------- -20 0 20 If I'm charting a value of -10, the rectangle on top needs to run from -10 to 0. If I'm charting a value of 10, the rectangle on top needs to run from 0 to 10. So how do I control where on the report the left side of the top rectangle falls? Just setting the width property of the rectangle no longer suffices. Is this something that can be done maybe with the reports CurrentX and CurrentY properties? I haven't used them before so I'm not sure. Thanks for your help. |
#3
| |||
| |||
|
|
On 25/05/2012 23:38:24, septimus wrote: I have an Access report with simple bar graphs that chart percent values between 0 and 100. No problem there, I just use the following line of code to size the dark rectangle (recPercentBar) on top of a lighter colored rectangle (rec100Bar) depending on the value of a double variable (dblValue): Me!recPercentBar.Width = CInt(Me!rec100Bar.Width * (dblValue / 100)) Here's where the problem comes in: I now have a need for a similar bar graph but this time the values run from -20 to 20 with 0 in the center, like this: ---------------------------------------- -20 * * * * * * * * *0 * * * * * * * * * * * 20 If I'm charting a value of -10, the rectangle on top needs to run from -10 to 0. If I'm charting a value of 10, the rectangle on top needs to run from 0 to 10. So how do I control where on the report the left side of the top rectangle falls? Just setting the width property of the rectangle no longer suffices. Is this something that can be done maybe with the reports CurrentX and CurrentY properties? I haven't used them before so I'm not sure. Thanks for your help. Me!recPercentBar.Left = something Me!recPercentBar.Top = something else (though this is probably a fixed value and need not be defined) Left is measured from the left of the report, Top is measured from the TOP of the sextion. Measurements are in Twips. There are 1440 Trips to the inch or 567 Twips to the Cm Phil |
![]() |
| Thread Tools | |
| Display Modes | |
| |