Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default how to superimpose chart images or extract data by vba

how to superimpose 2 charts or extract data by vba
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default how to superimpose chart images or extract data by vba

Here's part 2:

Macro to extract data from a chart in Excel
http://support.microsoft.com/kb/300643

Part 1 may be satisfied by creating a combination chart. What types of
chart are you trying to superimpose?

Actually superimposing one chart on another, requires you to equalize
the left and top positions and the width and height dimensions of the
two chart objects. You may also need to equalize these parameters for
the plot areas as well.

''''''''''''''''''''''''''''''' snippet

Dim cht1 As ChartObject
Dim cht2 As ChartObject

Set cht1 = ActiveSheet.ChartObjects(1)
Set cht2 = ActiveSheet.ChartObjects(2)

' equalize chart size and position
cht2.Left = cht1.Left
cht2.Top = cht1.Top
cht2.Width = cht1.Width
cht2.Height= cht1.Height

' temporarily shrink plot area
cht2.Chart.PlotArea.Width = cht2.Chart.PlotArea.Width / 2
cht2.Chart.PlotArea.Height= cht2.Chart.PlotArea.Height / 2

' equalize plot area size and position
cht2.Chart.PlotArea.Left = cht1.Chart.PlotArea.Left
cht2.Chart.PlotArea.Top = cht1.Chart.PlotArea.Top
cht2.Chart.PlotArea.Width = cht1.Chart.PlotArea.Width
cht2.Chart.PlotArea.Height= cht1.Chart.PlotArea.Height

''''''''''''''''''''''''''''''' end snippet

Long ago I posted a small utility to do this on my web site:

Align Excel Charts Using VBA
http://peltiertech.com/Excel/Charts/AlignCharts.html

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
how to superimpose 2 charts or extract data by vba

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default how to superimpose chart images or extract data by vba

If you are dealing with static images, then my suggestions will be of no
use. You can superimpose the two images, but if they are not the same
size, nor scaled the same, and if they don't have transparent
backgrounds, you will not gain anything from this exercise.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Jon Peltier wrote:
Here's part 2:

Macro to extract data from a chart in Excel
http://support.microsoft.com/kb/300643

Part 1 may be satisfied by creating a combination chart. What types of
chart are you trying to superimpose?

Actually superimposing one chart on another, requires you to equalize
the left and top positions and the width and height dimensions of the
two chart objects. You may also need to equalize these parameters for
the plot areas as well.

''''''''''''''''''''''''''''''' snippet

Dim cht1 As ChartObject
Dim cht2 As ChartObject

Set cht1 = ActiveSheet.ChartObjects(1)
Set cht2 = ActiveSheet.ChartObjects(2)

' equalize chart size and position
cht2.Left = cht1.Left
cht2.Top = cht1.Top
cht2.Width = cht1.Width
cht2.Height= cht1.Height

' temporarily shrink plot area
cht2.Chart.PlotArea.Width = cht2.Chart.PlotArea.Width / 2
cht2.Chart.PlotArea.Height= cht2.Chart.PlotArea.Height / 2

' equalize plot area size and position
cht2.Chart.PlotArea.Left = cht1.Chart.PlotArea.Left
cht2.Chart.PlotArea.Top = cht1.Chart.PlotArea.Top
cht2.Chart.PlotArea.Width = cht1.Chart.PlotArea.Width
cht2.Chart.PlotArea.Height= cht1.Chart.PlotArea.Height

''''''''''''''''''''''''''''''' end snippet

Long ago I posted a small utility to do this on my web site:

Align Excel Charts Using VBA
http://peltiertech.com/Excel/Charts/AlignCharts.html

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
how to superimpose 2 charts or extract data by vba

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default how to superimpose chart images or extract data by vba

thanks to Jon,

Actually my problem is to call out the yield curve (line graph) from the
same web but for different date. Thus both images have the same axis. The
easiest way for immedaite comparison is to superimpose both, get the top
peice of transparent abckground (here is the problem I cannot manage). If I
can extract data from the graph by VBA, so much the better. I can then do
deeper analysis.

as for your macro. I shall try on that this week-end.

"Jon Peltier" wrote:

If you are dealing with static images, then my suggestions will be of no
use. You can superimpose the two images, but if they are not the same
size, nor scaled the same, and if they don't have transparent
backgrounds, you will not gain anything from this exercise.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Jon Peltier wrote:
Here's part 2:

Macro to extract data from a chart in Excel
http://support.microsoft.com/kb/300643

Part 1 may be satisfied by creating a combination chart. What types of
chart are you trying to superimpose?

Actually superimposing one chart on another, requires you to equalize
the left and top positions and the width and height dimensions of the
two chart objects. You may also need to equalize these parameters for
the plot areas as well.

''''''''''''''''''''''''''''''' snippet

Dim cht1 As ChartObject
Dim cht2 As ChartObject

Set cht1 = ActiveSheet.ChartObjects(1)
Set cht2 = ActiveSheet.ChartObjects(2)

' equalize chart size and position
cht2.Left = cht1.Left
cht2.Top = cht1.Top
cht2.Width = cht1.Width
cht2.Height= cht1.Height

' temporarily shrink plot area
cht2.Chart.PlotArea.Width = cht2.Chart.PlotArea.Width / 2
cht2.Chart.PlotArea.Height= cht2.Chart.PlotArea.Height / 2

' equalize plot area size and position
cht2.Chart.PlotArea.Left = cht1.Chart.PlotArea.Left
cht2.Chart.PlotArea.Top = cht1.Chart.PlotArea.Top
cht2.Chart.PlotArea.Width = cht1.Chart.PlotArea.Width
cht2.Chart.PlotArea.Height= cht1.Chart.PlotArea.Height

''''''''''''''''''''''''''''''' end snippet

Long ago I posted a small utility to do this on my web site:

Align Excel Charts Using VBA
http://peltiertech.com/Excel/Charts/AlignCharts.html

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
how to superimpose 2 charts or extract data by vba


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default how to superimpose chart images or extract data by vba

Remember: the macros I posted will work on charts.

You might be able to save the image as a GIF or PNG, open it in an image
editor (I like IrfanVIEW), and save it with white as the transparent color.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
thanks to Jon,

Actually my problem is to call out the yield curve (line graph) from the
same web but for different date. Thus both images have the same axis. The
easiest way for immedaite comparison is to superimpose both, get the top
peice of transparent abckground (here is the problem I cannot manage). If I
can extract data from the graph by VBA, so much the better. I can then do
deeper analysis.

as for your macro. I shall try on that this week-end.

"Jon Peltier" wrote:

If you are dealing with static images, then my suggestions will be of no
use. You can superimpose the two images, but if they are not the same
size, nor scaled the same, and if they don't have transparent
backgrounds, you will not gain anything from this exercise.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Jon Peltier wrote:
Here's part 2:

Macro to extract data from a chart in Excel
http://support.microsoft.com/kb/300643

Part 1 may be satisfied by creating a combination chart. What types of
chart are you trying to superimpose?

Actually superimposing one chart on another, requires you to equalize
the left and top positions and the width and height dimensions of the
two chart objects. You may also need to equalize these parameters for
the plot areas as well.

''''''''''''''''''''''''''''''' snippet

Dim cht1 As ChartObject
Dim cht2 As ChartObject

Set cht1 = ActiveSheet.ChartObjects(1)
Set cht2 = ActiveSheet.ChartObjects(2)

' equalize chart size and position
cht2.Left = cht1.Left
cht2.Top = cht1.Top
cht2.Width = cht1.Width
cht2.Height= cht1.Height

' temporarily shrink plot area
cht2.Chart.PlotArea.Width = cht2.Chart.PlotArea.Width / 2
cht2.Chart.PlotArea.Height= cht2.Chart.PlotArea.Height / 2

' equalize plot area size and position
cht2.Chart.PlotArea.Left = cht1.Chart.PlotArea.Left
cht2.Chart.PlotArea.Top = cht1.Chart.PlotArea.Top
cht2.Chart.PlotArea.Width = cht1.Chart.PlotArea.Width
cht2.Chart.PlotArea.Height= cht1.Chart.PlotArea.Height

''''''''''''''''''''''''''''''' end snippet

Long ago I posted a small utility to do this on my web site:

Align Excel Charts Using VBA
http://peltiertech.com/Excel/Charts/AlignCharts.html

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
how to superimpose 2 charts or extract data by vba



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default how to superimpose chart images or extract data by vba

thanks to Jon

I shall try on that.

"Jon Peltier" wrote:

Remember: the macros I posted will work on charts.

You might be able to save the image as a GIF or PNG, open it in an image
editor (I like IrfanVIEW), and save it with white as the transparent color.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
thanks to Jon,

Actually my problem is to call out the yield curve (line graph) from the
same web but for different date. Thus both images have the same axis. The
easiest way for immedaite comparison is to superimpose both, get the top
peice of transparent abckground (here is the problem I cannot manage). If I
can extract data from the graph by VBA, so much the better. I can then do
deeper analysis.

as for your macro. I shall try on that this week-end.

"Jon Peltier" wrote:

If you are dealing with static images, then my suggestions will be of no
use. You can superimpose the two images, but if they are not the same
size, nor scaled the same, and if they don't have transparent
backgrounds, you will not gain anything from this exercise.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Jon Peltier wrote:
Here's part 2:

Macro to extract data from a chart in Excel
http://support.microsoft.com/kb/300643

Part 1 may be satisfied by creating a combination chart. What types of
chart are you trying to superimpose?

Actually superimposing one chart on another, requires you to equalize
the left and top positions and the width and height dimensions of the
two chart objects. You may also need to equalize these parameters for
the plot areas as well.

''''''''''''''''''''''''''''''' snippet

Dim cht1 As ChartObject
Dim cht2 As ChartObject

Set cht1 = ActiveSheet.ChartObjects(1)
Set cht2 = ActiveSheet.ChartObjects(2)

' equalize chart size and position
cht2.Left = cht1.Left
cht2.Top = cht1.Top
cht2.Width = cht1.Width
cht2.Height= cht1.Height

' temporarily shrink plot area
cht2.Chart.PlotArea.Width = cht2.Chart.PlotArea.Width / 2
cht2.Chart.PlotArea.Height= cht2.Chart.PlotArea.Height / 2

' equalize plot area size and position
cht2.Chart.PlotArea.Left = cht1.Chart.PlotArea.Left
cht2.Chart.PlotArea.Top = cht1.Chart.PlotArea.Top
cht2.Chart.PlotArea.Width = cht1.Chart.PlotArea.Width
cht2.Chart.PlotArea.Height= cht1.Chart.PlotArea.Height

''''''''''''''''''''''''''''''' end snippet

Long ago I posted a small utility to do this on my web site:

Align Excel Charts Using VBA
http://peltiertech.com/Excel/Charts/AlignCharts.html

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Davyboom wrote:
how to superimpose 2 charts or extract data by vba


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Superimpose one chart on another Kirsten Charts and Charting in Excel 2 April 27th 23 03:47 AM
Superimpose one Pipeline chart over another ogerriz Charts and Charting in Excel 1 May 21st 09 09:14 AM
Superimpose one tornado chart over another ogerriz Charts and Charting in Excel 0 May 18th 09 04:46 AM
How do I extract and save hyperlinks from images in excel Robert in Brisbane Excel Discussion (Misc queries) 4 December 29th 06 12:55 PM
How can I superimpose one chart over the other? sas1950 Charts and Charting in Excel 1 August 17th 05 04:49 AM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"