+ Reply to Thread
Results 1 to 6 of 6

Height (in points) of data point in chart above x-axis

  1. #1
    Scott P
    Guest

    Height (in points) of data point in chart above x-axis

    Hi,

    Is it possible using VBA to determine the height of a given data point in a
    Chart worksheet in Excel above the x-axis in terms of points? I can use the
    InsideHeight property in VBA to get the height of the plot area in points,
    but I am really interested in determining the number of points above the
    x-axis a data point sits.

    Thank you in advance for any assistance with this matter.

  2. #2
    Jon Peltier
    Guest

    Re: Height (in points) of data point in chart above x-axis

    Scott -

    What are you trying to do? It may not be necessary to determine the
    number of points to get the effect you want. There might be a native
    feature you haven't yet discovered, or perhaps you need a trick that
    someone else has already worked out.

    But if you need the number of points, you can probably use some of the
    code on the following web page to get started. The page shows ways to
    use drawing objects to embellish a chart in ways that native chart
    elements cannot be coerced to do.

    http://peltiertech.com/Excel/Charts/VBAdraw.html

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______


    Scott P wrote:

    > Hi,
    >
    > Is it possible using VBA to determine the height of a given data point in a
    > Chart worksheet in Excel above the x-axis in terms of points? I can use the
    > InsideHeight property in VBA to get the height of the plot area in points,
    > but I am really interested in determining the number of points above the
    > x-axis a data point sits.
    >
    > Thank you in advance for any assistance with this matter.


  3. #3
    Scott P
    Guest

    Re: Height (in points) of data point in chart above x-axis

    Thank you for your reply and suggestion, Jon. I am trying to calculate the
    aspect ratio of a chart in a Chart worksheet using the InsideWidth property
    as the width of the chart and I would like to use the distance between the
    max and min y-values in the series being charted as the height of the chart.

    Are you aware of any way to determine the "height" of a data point in a
    series above/below the x-axis given the y-value of that data point, as
    measured in points? Thank you again.

    "Jon Peltier" wrote:

    > Scott -
    >
    > What are you trying to do? It may not be necessary to determine the
    > number of points to get the effect you want. There might be a native
    > feature you haven't yet discovered, or perhaps you need a trick that
    > someone else has already worked out.
    >
    > But if you need the number of points, you can probably use some of the
    > code on the following web page to get started. The page shows ways to
    > use drawing objects to embellish a chart in ways that native chart
    > elements cannot be coerced to do.
    >
    > http://peltiertech.com/Excel/Charts/VBAdraw.html
    >
    > - Jon
    > -------
    > Jon Peltier, Microsoft Excel MVP
    > Peltier Technical Services
    > Tutorials and Custom Solutions
    > http://PeltierTech.com/
    > _______
    >
    >
    > Scott P wrote:
    >
    > > Hi,
    > >
    > > Is it possible using VBA to determine the height of a given data point in a
    > > Chart worksheet in Excel above the x-axis in terms of points? I can use the
    > > InsideHeight property in VBA to get the height of the plot area in points,
    > > but I am really interested in determining the number of points above the
    > > x-axis a data point sits.
    > >
    > > Thank you in advance for any assistance with this matter.

    >


  4. #4
    Jon Peltier
    Guest

    Re: Height (in points) of data point in chart above x-axis

    It's all just 8th grade algebra, so go find an 8th grader.

    Aspect ratio is just InsideWidth/InsideHeight.

    Distance above axis, in points, get the Y value of the point, subtract the "X Axis
    Crosses At" value, divide by the Y axis Maximum Scale - Minimum Scale, multiply by
    Inside Height.

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Scott P wrote:

    > Thank you for your reply and suggestion, Jon. I am trying to calculate the
    > aspect ratio of a chart in a Chart worksheet using the InsideWidth property
    > as the width of the chart and I would like to use the distance between the
    > max and min y-values in the series being charted as the height of the chart.
    >
    > Are you aware of any way to determine the "height" of a data point in a
    > series above/below the x-axis given the y-value of that data point, as
    > measured in points? Thank you again.
    >
    > "Jon Peltier" wrote:
    >
    >
    >>Scott -
    >>
    >>What are you trying to do? It may not be necessary to determine the
    >>number of points to get the effect you want. There might be a native
    >>feature you haven't yet discovered, or perhaps you need a trick that
    >>someone else has already worked out.
    >>
    >>But if you need the number of points, you can probably use some of the
    >>code on the following web page to get started. The page shows ways to
    >>use drawing objects to embellish a chart in ways that native chart
    >>elements cannot be coerced to do.
    >>
    >> http://peltiertech.com/Excel/Charts/VBAdraw.html
    >>
    >>- Jon
    >>-------
    >>Jon Peltier, Microsoft Excel MVP
    >>Peltier Technical Services
    >>Tutorials and Custom Solutions
    >>http://PeltierTech.com/
    >>_______
    >>
    >>
    >>Scott P wrote:
    >>
    >>
    >>>Hi,
    >>>
    >>>Is it possible using VBA to determine the height of a given data point in a
    >>>Chart worksheet in Excel above the x-axis in terms of points? I can use the
    >>>InsideHeight property in VBA to get the height of the plot area in points,
    >>>but I am really interested in determining the number of points above the
    >>>x-axis a data point sits.
    >>>
    >>>Thank you in advance for any assistance with this matter.

    >>



  5. #5
    Scott P
    Guest

    Re: Height (in points) of data point in chart above x-axis

    Thank you for your follow-up, Jon. I am familiar with the algebra/geometry
    at work here. Perhaps I should have been more specific in my post -- I am
    really just looking for a Property related to a Chart that returns the
    vertical distance of a point to the x-axis.

    I could not find such a Property so I will use the general approach as
    outlined below. Thanks again.

    "Jon Peltier" wrote:

    > It's all just 8th grade algebra, so go find an 8th grader.
    >
    > Aspect ratio is just InsideWidth/InsideHeight.
    >
    > Distance above axis, in points, get the Y value of the point, subtract the "X Axis
    > Crosses At" value, divide by the Y axis Maximum Scale - Minimum Scale, multiply by
    > Inside Height.
    >
    > - Jon
    > -------
    > Jon Peltier, Microsoft Excel MVP
    > Peltier Technical Services
    > Tutorials and Custom Solutions
    > http://PeltierTech.com/
    > _______
    >
    > Scott P wrote:
    >
    > > Thank you for your reply and suggestion, Jon. I am trying to calculate the
    > > aspect ratio of a chart in a Chart worksheet using the InsideWidth property
    > > as the width of the chart and I would like to use the distance between the
    > > max and min y-values in the series being charted as the height of the chart.
    > >
    > > Are you aware of any way to determine the "height" of a data point in a
    > > series above/below the x-axis given the y-value of that data point, as
    > > measured in points? Thank you again.
    > >
    > > "Jon Peltier" wrote:
    > >
    > >
    > >>Scott -
    > >>
    > >>What are you trying to do? It may not be necessary to determine the
    > >>number of points to get the effect you want. There might be a native
    > >>feature you haven't yet discovered, or perhaps you need a trick that
    > >>someone else has already worked out.
    > >>
    > >>But if you need the number of points, you can probably use some of the
    > >>code on the following web page to get started. The page shows ways to
    > >>use drawing objects to embellish a chart in ways that native chart
    > >>elements cannot be coerced to do.
    > >>
    > >> http://peltiertech.com/Excel/Charts/VBAdraw.html
    > >>
    > >>- Jon
    > >>-------
    > >>Jon Peltier, Microsoft Excel MVP
    > >>Peltier Technical Services
    > >>Tutorials and Custom Solutions
    > >>http://PeltierTech.com/
    > >>_______
    > >>
    > >>
    > >>Scott P wrote:
    > >>
    > >>
    > >>>Hi,
    > >>>
    > >>>Is it possible using VBA to determine the height of a given data point in a
    > >>>Chart worksheet in Excel above the x-axis in terms of points? I can use the
    > >>>InsideHeight property in VBA to get the height of the plot area in points,
    > >>>but I am really interested in determining the number of points above the
    > >>>x-axis a data point sits.
    > >>>
    > >>>Thank you in advance for any assistance with this matter.
    > >>

    >
    >


  6. #6
    Jon Peltier
    Guest

    Re: Height (in points) of data point in chart above x-axis

    Scott -

    You couldn't find the property you were looking for, because it doesn't exist. Hence
    the need for roundabout calculations.

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    Scott P wrote:

    > Thank you for your follow-up, Jon. I am familiar with the algebra/geometry
    > at work here. Perhaps I should have been more specific in my post -- I am
    > really just looking for a Property related to a Chart that returns the
    > vertical distance of a point to the x-axis.
    >
    > I could not find such a Property so I will use the general approach as
    > outlined below. Thanks again.
    >
    > "Jon Peltier" wrote:
    >
    >
    >>It's all just 8th grade algebra, so go find an 8th grader.
    >>
    >>Aspect ratio is just InsideWidth/InsideHeight.
    >>
    >>Distance above axis, in points, get the Y value of the point, subtract the "X Axis
    >>Crosses At" value, divide by the Y axis Maximum Scale - Minimum Scale, multiply by
    >>Inside Height.
    >>
    >>- Jon
    >>-------
    >>Jon Peltier, Microsoft Excel MVP
    >>Peltier Technical Services
    >>Tutorials and Custom Solutions
    >>http://PeltierTech.com/
    >>_______
    >>
    >>Scott P wrote:
    >>
    >>
    >>>Thank you for your reply and suggestion, Jon. I am trying to calculate the
    >>>aspect ratio of a chart in a Chart worksheet using the InsideWidth property
    >>>as the width of the chart and I would like to use the distance between the
    >>>max and min y-values in the series being charted as the height of the chart.
    >>>
    >>>Are you aware of any way to determine the "height" of a data point in a
    >>>series above/below the x-axis given the y-value of that data point, as
    >>>measured in points? Thank you again.
    >>>
    >>>"Jon Peltier" wrote:
    >>>
    >>>
    >>>
    >>>>Scott -
    >>>>
    >>>>What are you trying to do? It may not be necessary to determine the
    >>>>number of points to get the effect you want. There might be a native
    >>>>feature you haven't yet discovered, or perhaps you need a trick that
    >>>>someone else has already worked out.
    >>>>
    >>>>But if you need the number of points, you can probably use some of the
    >>>>code on the following web page to get started. The page shows ways to
    >>>>use drawing objects to embellish a chart in ways that native chart
    >>>>elements cannot be coerced to do.
    >>>>
    >>>> http://peltiertech.com/Excel/Charts/VBAdraw.html
    >>>>
    >>>>- Jon
    >>>>-------
    >>>>Jon Peltier, Microsoft Excel MVP
    >>>>Peltier Technical Services
    >>>>Tutorials and Custom Solutions
    >>>>http://PeltierTech.com/
    >>>>_______
    >>>>
    >>>>
    >>>>Scott P wrote:
    >>>>
    >>>>
    >>>>
    >>>>>Hi,
    >>>>>
    >>>>>Is it possible using VBA to determine the height of a given data point in a
    >>>>>Chart worksheet in Excel above the x-axis in terms of points? I can use the
    >>>>>InsideHeight property in VBA to get the height of the plot area in points,
    >>>>>but I am really interested in determining the number of points above the
    >>>>>x-axis a data point sits.
    >>>>>
    >>>>>Thank you in advance for any assistance with this matter.
    >>>>

    >>



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1