Re: Positioning datalabels



Thanks for replying

Now even more confused

As far as I know, points atre 1/72 of an inch and pixels are all to do with
screen resolution

This routine, nicked from Stephen Lebans, returns 96 for my screen
resolution (Pixels per inch??????)

Phil

Option Explicit


Private Declare Function apiCreateIC Lib "gdi32" Alias "CreateICA" _
(ByVal lpDriverName As String, ByVal lpDeviceName As String, _
ByVal lpOutput As String, lpInitData As Any) As Long

Private Declare Function apiGetDeviceCaps Lib "gdi32" _
Alias "GetDeviceCaps" (ByVal hDC As Long, ByVal nIndex As Long) As Long


Private Declare Function apiDeleteDC Lib "gdi32" _
Alias "DeleteDC" (ByVal hDC As Long) As Long


Private Const LOGPIXELSX = 88
Global Const TwipsPerMM = 56.7
Global Const PointsPerMM = 2.83

Dim lngXdpi As Long


Function GetScreenResolution() As Long

Dim lngIC As Long

'Get Screen resolution
lngIC = apiCreateIC("DISPLAY", vbNullString, vbNullString, vbNullString)
'If the call to CreateIC didn't fail, then get the Screen X resolution.
If lngIC <> 0 Then
lngXdpi = apiGetDeviceCaps(lngIC, LOGPIXELSX)
GetScreenResolution = lngXdpi
'Release the information context.
apiDeleteDC (lngIC)
Else
' Something has gone wrong. Assume an average value.
lngXdpi = 120
GetScreenResolution = lngXdpi
End If

End Function


"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:077CB7A1-45AD-4F1A-A862-3CB93BA33A09@xxxxxxxxxxxxxxxx
Points and pixels are the same. Sorry for the confusion.

"Phil Stanton" wrote:

Sound what I need, thanks

How do I get the pixle values as I thought chart dimensions were in
points

Phil


"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7BB34AEB-E320-4997-915F-4A24BC28A77C@xxxxxxxxxxxxxxxx
This problem is similar to a macro I run at work all the time. I
needed
to
drop a line on a chart at a particular X value. I used simple ratios
as
expalined below

Suppose your x axis goes from 10 to 100 and you need to find the value
of
50
then

X_Ratio = (50 - 10)/(100 - 10)

Then if the pixel values of the chart goes from 1000 to 2000. You can
get
thiese numbers from the .left parameter and the .width parameter of the
chart.

X_Pixel = (X_Ratio * (2000 - 1000)) + 1000

"Phil Stanton" wrote:

I have a scatter chart and I want to be able to position the labels
differently for each point ( depending on the space available on the
chart)

I know the X & Y co-ordinates of the points in the series.

The chart is 622 point wide and the interior width of the plot area is
422
point wide. I know the height and width of the label

If for example I want to place a particular label exactly over a
point,
what
is the calculation using the X co-ordinate, widths to give me the
DataLabel.Left value

Thanks for any help

Phil








.



Relevant Pages

  • Re: screen resolution
    ... That is the double-edged sword of changing the screen resolution - you get more stuff on the screen, but much of the stuff that there get's smaller. ... Screen res determines how many pixels of information are displayed on the screen; many items displayed on a PC are "pictures" composed of a fixed number of pixels. ... For example, if a screen icon is 100x100 pixels and the resolution of your monitor is set to 640x480, that icon would be filling up about a fifth of the screen vertically. ... using Photoshop the more pixels per inch the sharper an image will be. ...
    (microsoft.public.windows.mediacenter)
  • Re: Pen created using ExtCreatePen fails to get selected into a metafi
    ... the screen resolution or printer resolution. ... For example, on a 600x800 display, 5 pixels ... You might find, in graphics-intensive drawing, that it makes more sense to do ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: tex4ht: wrong image sizes
    ... would have required installing some new fonts, ... The article explicitly says that a point is an absolute ... and that the display should calculate how many pixels are to be used for each point ... depends on the screen resolution? ...
    (comp.text.tex)
  • Re: Inserting jpg images
    ... What you can do is after inserting the picture you can go to View | Source Edit and then click on the source tab and then set the width and height of the image in the IMG element to fix it to the size in pixels that you want. ... > assumed that the typical screen resolution is 80 or so dots per inch, ... > image to force the desired visual display, ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Is it possible to reset the screen resolution in Javascript?
    ... a resolution of 1024 by 768 pixels. ... force a particular screen resolution? ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)