Excel chart - create second axis

I've created a script which makes an Excel object, takes some data, generates a chart and then exports the chart as a JPG. The thing is it's a CPU report with one series for Mhz and one for % - and using only one axis results in it ending in the thousands
and not being able to see the second series. Do you know how to specify a second axis on the right-hand side (left for Mhz right for %) which would only go up to 100? I don't even know how to do it in Excel, never mind PowerShell.
Thanks in advance. Oh yeah, here's my code:
# Generate graph
$xRow = 1
$yRow = $rows
$objRange=$Worksheet.range("a${xRow}:c${yRow}")
$colCharts=$excel.Charts
$objChart=$colCharts.Add()
$objChart.ChartType=4
$objChart.Axes(0).CategoryType=2
$objChart.Axes(0).TickLabelSpacing=7
$objChart.HasTitle = $true
$objChart.ChartTitle.text = "CPU Report"
$a=$objChart.Activate
$savepath = "C:\"
$a=$objChart.export($savepath + "cpu.jpg","JPG")

Hi Bobbinspenguin,
If you want to add a second series in Excel chart with powershell, please refer to this article:
Tutorial: PowerShell and Microsoft Chart Controls (or How To Spice Up Your Reports)
I hope this helps.

Similar Messages

  • How to create 2-Axis chart all sharing x values?

    Hello,
    I'm trying to create a 2-Axis chart while preserving x-value sharing, i.e. my four paired data sets should be plotted in Scatter mode, I think. To be more clear, I wish to "combine these two charts below into one", with the second Y-axis on the right for the second chart (whose numbers are obviously higher):
    When I attempt to create a 2-Axis chart via the Insert menu, it changes the x-axis data (mAs) into its own data set, treating it as if it were a dependent variable:
    mAs is the independent variable, upon which the others depend ... I can't figure out how to get Numbers to realize this. Sorry for my rambling tone -- I think I should call it a night, but I wish to get this done. Is my problem clear? I want to create a 2-Axis chart, effectively "combining" those first two scatter charts into one 2-Axis scatter chart. Please help!
    Thank you for your time and assistance.

    ER,
    There is no option for a two-axis Scatter Chart. You can simulate it by scaling your data in such a way that it fits the chart and aligns with a second axis that you manually paste into the Sheet and combine with the chart so that it appears to belong there.
    Only the Scatter Chart plots values vs. values. All the other charts plot values against category names (text).
    Regards,
    Jerry

  • Excel chart alignment problems when creating PDF

    My excel chart is off set on my PDF page after creating PDF from Macro.  The chart is within my print areas in excel and no matter where I position the chart in excel the chart shows up like it is indented on the PDF and runs off the page.  I can print from excel and the results are fine.  I am operating a windows 2007 64 bit machine with excel 2007 and ADOBE Acrobat 9 Pro & Adobe Reader X.
    I am running the following code by Ron de Bruin to generate the PDF
    Myvar.ExportAsFixedFormat _
       Type:=xlTypePDF, _
       FileName:=Fname, _
       Quality:=xlQualityStandard, _
       IncludeDocProperties:=True, _
       IgnorePrintAreas:=False, _
      OpenAfterPublish:=OpenPDFAfterPublish
    No matter what I do I can not get the chart completely in the page through VBA.  The VBA code works fine it is the results of the PDF I can't seem to fix.
    Many thanks for any help.

    Hi,
         I tried to do the same with a Excel having a so much content. I tried to print that file into a PDF file, I saw the output file as expected. I think there might be some different settings in your PDF printer. Can you please send me the screenshot of PDF Printer Dialog Box launched after invoking Print To PDF from Excel?

  • Change the x-axis series in excel chart

    Hi,
        While plotting an Excel chart using ExcelRpt_ChartWizard(), the x - axis series starts from 0, 1, 2, 3... I like to change the series according to the data present in a particular column. Eg. If column 2 contains 2, 5, 7, 6.2... then the x-axis should be in the order 2, 5, 7, 6.2.....
    Can anyone help me regarding this issue?

    Hi,
    Many thanks for this post, It's been quite helpful since there seems no to be so much info available about not so basic generation and manipulation of excels graphs with LabWindows (at least compared to C#).
    I am struggling to set my own X-Axis as well but the best I can get is the graph looking like the one of the attached file.
    The first row for the X-Axis is 11:47:00 and the last one is 17:46:25, however I get a graph between 0:00:00 and 19:12:00.
    May thanks,
    Best regards
    Attachments:
    Graph with LW.png ‏14 KB

  • Acrobat X Pro does not print Excel charts from 2010 Word doc to PDF correctly

    Hi,
    I am trying to create a PDF from Word 2010 using Adobe Acrobat X and preserve hyperlinks but when I go through the PDF maker toolbar, the Excel charts in the Word file do not print correctly. They come up as large white boxes with a small grey arrow icon in the lower-right corner (looks like a "play" button). Does anyone know why this is and if there's a solution to this problem? Is there an update or a fix? I have a lot of Excel charts in the Word file...
    Thanks in adavance,
    Kika

    Hello,
    i am having exactly the same issue with Acrobat X Pro - with linked Excel 2010 tables in Word 2010.
    Has there been a resolution to this eissue - it is potentially very time consuming to work around this issue for me.
    I would post my files but I don't know how to attach them to the thread - only my second post .
    Cheers,
    slobbering_dog
    This is the Word File - the table is an Excel 2010 spreadsheet linked (via Paste Special >Link) .
    This is the resultant PDF file:
    Thanks in advance - again !!
    Message was edited by: slobbering_dog_72

  • Having trouble formatting excel chart using Chart Wizard command.

    Problem Description :
    Trying to create an excel chart derived from an excel spreadsheet. Having trouble understanding the parameters to format in the Chart Wizard function to get the desired results. There are no error messages, just chart is not what expected.
    Goal:
    Chart with temperature on the left, y-axis. 3 lines on the graph for min meas temp, avg meas temp, max meas temp.
    Bottom x-axis should contain year/month values.
    Chart Wizard command:
    status = ExcelRpt_ChartWizard (chart_temperature_handle, chart_data_worksheet_handle, D1:G3, ExRConst_GalleryLine, ExRConst_Rows, 0, 0, 0, 1, "Temperature Stats", "Year/Month", "Temp F", NULL)
    NI Software : LabWindows/CVI version 8.0.1
    NI Hardware : None device
    Driver Version :
    OS : Windows XP
    Customer Information :
    Mary Claflin
    Technology Kitchen Corporation
    US
    [email protected]
    Ph: (512) 965-4722

    Hi Mary,
    Looking at the Chart Wizard within Excel, it appears as though the only
    chart type that allows us to give a series of values for our XAxis
    would be the XY Scatter plot. There IS an option for this when using
    the CVI Excel Report function calls (specifying
    ExRConst_GalleryXYScatter for the plot type).
    However, it appears that there are not any Excel report chart functions
    available in CVI to specify anything other than the general "series"
    object. When this object is sent through as a variant data type to
    Excel, Excel appears to automatically convert this single object into
    separate data series. This is because Excel is not immediately aware
    that we are attempting to use a Scatter plot, and thus must convert
    each column into a separate series. There is no object defined in the
    Excel report that would be able to handle the "Xseries" and "Yseries"
    option that are seen in the chart creation wizard within Excel. Thus,
    we have no way of specifying a different set of data for our XAxis.
    It appears as though, at least for our own CVI functions, that there is
    no way to accomplish your goal. Since CVI is based around C - we CAN
    call any ActiveX client registered on the system. Because of this, we
    should be able to talk with Excel directly without the help of the CVI
    Excel Report functions, although this may be more difficult.
    I haven't been able to find any specific C example code, but here is
    the Excel Object Model on which calls to Excel will most likely be
    based:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrconexcelobjectmodeloverview.asp
    Sorry for the inconvenience Mary.
    Dan Weiland

  • Setting the aixs minimum in excel chart using OLE.

    Hi All,
              The problem am facing is that say if all the values in the chart data range is high  then excel adjusts itself so that the axis minimum doesn't start from zero. But i need the axis to always start from zero. How do i set this using OLE?

    Hi
    Here is ur expected coding...
    REPORT ZCREATEEXCEL.
    TYPE-POOLS OLE2.
    DATA: EXCEL TYPE OLE2_OBJECT,
    WORKBOOKS TYPE OLE2_OBJECT,
    WORKBOOK TYPE OLE2_OBJECT.
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    START THE EXCEL APPLICATION
    CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
    PUT EXCEL IN FRONT
    SET PROPERTY OF EXCEL 'VISIBLE' = 1.
    PERFORM ERR_HDL.
    INFORM USER OF THE CURRENT STATUS
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    PERCENTAGE = 0
    TEXT = TEXT-I08
    EXCEPTIONS
    OTHERS = 1.
    CREATE AN EXCEL WORKBOOK OBJECT
    CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOKS.
    PERFORM ERR_HDL.
    CALL METHOD OF WORKBOOKS 'ADD' = WORKBOOK.
    PERFORM ERR_HDL.
    EXCEL FILENAME
    CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
    SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
    CALL METHOD OF WORKBOOK 'SAVEAS' EXPORTING #1 = FILENAME.
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
    WRITE: / 'OLE ERROR: RETURN CODE ='(I10), SY-SUBRC.
    STOP.
    ENDIF.
    ENDFORM.
    Reward if usefull

  • How to link Excel Chart with multiple columns dynamically?

    Hi all,
    I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
    Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
    Now, how to do it at runtime through LabVIEW 8.0?
    Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it. 
    It is tough since I don't know how to assign SourceData of the chart through labview.
    I have attached chart's SourceData picture.
    Hope you all can solve my problem.
    The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
    good is the name of the file.
    The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
    See the columns vary from A to F.
    I have still not got what I love.....
    Attachments:
    ExcelChart.JPG ‏113 KB
    SourceData.JPG ‏34 KB
    XY values.JPG ‏36 KB

    Ok i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
    Message Edited by Halemani on 09-19-2008 06:33 AM
    I have still not got what I love.....
    Attachments:
    Chart_XValues_Values.JPG ‏36 KB

  • How to put header and footer information in excel chart

    I modified the create chart.vi, I got from this site and able to create a chart from *.xls file. Now I want to print the filename as header and date and time the chart created as footer in the excel chart. Any idea is appreciated.
    Thank you
    MM
    Attachments:
    Create_Rundown_Chart.vi ‏246 KB
    SN20755-Horiz_1-031027-160128-rundowndata.xls ‏15 KB

    Under the property node _Chart where you have the ChartTitle, add the property PageSetup. Cascade that into another property node and choose CenterHeader and CenterFooter. You can write the strings directly into these properties. Use the following codes:
    Filename = &F, Date = &D, Time = &T
    Be sure to close all references that do not leave the page (ie. Chart, Legend, ChartArea, etc.). Otherwise Excel will hang later on.
    Michael Munroe
    www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How do you extend a chart's x-axis range?

    Hello,
    Is it possible to extend a chart's x-axis range to ten seconds, rather than the default five seconds?
    I've attached a simplified portion of my code, which contains a DAQ Assistant connected to a chart. I've played around with the chart history length, sampling frequency, and sample numbers; however the chart's x-axis range remains a constant five seconds. I feel this is a relatively fundamental concept, but it eludes me.
    Settings currently set to:
    Sampling Frequency: 2k Hz
    Samples Read: 200
    Acquisition Mode: Continuous sampling
    Chart Update Mode: Strip
    Chart History Length: 1024
    Solved!
    Go to Solution.
    Attachments:
    sampling test.vi ‏73 KB

    Thank you. I feel foolish as this was trivial:
    For those who don't know:
    Right-click the chart
    Select X-Scale->Properties
    Under the Scales tab, enter your time range in the minimum and maximum boxes.

  • Why are excel charts copied to Illustrator CS 5.1 now coming in as pictures?

    I've been creating charts in Excel 2004 for Mac for years and copying them into Illustrator. They have always previously pasted into Illustrator as vectors illustrations. I've created hundreds of charts in Excel before and copied them to Illustrator to "dress them up" for reports with no problems. I just created a chart in Excel 2004 for Mac and copied it to Illustrator and it came in as a picture. This is the first time I have ever had this happen with an Excel chart.
    I've searched various sites and have not found anyone who's run into this issue.
    Any ideas?

    I have never printed to pdf from Excel. I have always just copied the actual chart and pasted it into Illustrator, then worked on it there.
    The image below is from one of the charts that originated in Excel and then was "dressed up" in Illustrator. It was a fairly complicated chart but it came into Illustrator with no problems whatsoever. (The Excel chart was fairly basic - specifically to avoid any issues when pasting into Illustrator.) All of the drop shadows and other embellishments were made in Illustrator.
    My system has not changed  - other than the usual MS Office updates.

  • Copy Excel Chart into Illustrator: Problem with dotted lines

    Copying an excel chart (2010 and/or 2013, Windows 7 Ultimate) to Illustrator CS6 works okay if line chart lines are solid... but if they are dotted, then in Excel 2010, the dotted line becomes jumbled, and in Excel 2013, the dotted line converts to a solid line... is the only solution to this to save the exel chart as a pdf, or is there another workaround?
    Essentially, I am creating a chart in excel and adding a few notations and graphic elements in illustrator for professional publishing...
    any help would be appreciated... thanks

    This is a follow-up (somehow, my original question was logged under OOBIMICHAEL):
    I finally broke down and bought a MacBook Pro, installed CS6 and Office 2011... and voilà... dotted lines copy from excel to illustrator just perfectly... this is a bit like copying data from Visio to Word, etc... these programs render graphics in very different ways... other than the Mac solution, I also tried the Libre Suite (open source)... which also worked perfectly to copy excel data with dotted lines to illustrator... so, until MS and Adobe actually collaborate together to provide value to its customers, the alternative seems (1) open source, (2) buy a Mac...

  • Excel charts become blury when pasted...help?

    Hi,
    I am using CS4 on Windows 7.
    I am putting together a report which requires me to insert Excel charts into my InDesign document.
    I am having a problem...when I "paste" the copied chart over into InDesign, parts of the chart look pixelated and fuzzy/blury.
    I have tried various things such as making the chart bigger and smaller then pasting, it seems to get worse. I also tried just doing a screenshot of my chart then making it into a JPG in Photoshop and placing that. It worked very well with one chart, but all the others are even worse than when I just paste.
    Does anyone know of this problem? I want this preentation to look really professional, and fuzzy lines around my bar chart just won't do!
    Please help??
    Thanks!

    Thanks for the suggestions guys
    Well, I tried making it a lot larger in excel and then doing the copy/paste. The graphic itself came out nice and crisp, but the text on the axis i now so tiny you cannot read it, nor the text in the legend. Getting frustrated!
    I also tried the copy/paste into Illustrator and save out as a .AI file then file>place. This came out with very rough edges and looking awful. I don't use AI and really don't know what I am doing so I could be doing it wrong.
    Sigh.....it seems SO simple, very frustrating!
    Any suggestion to remedy this?
    Thanks a million!

  • Chart options: Y axis scale

    Hi,
    I created a bar chart for a report that simly displays the count for each distinct value of a field.  I would want the Y scale (which displays the count) to only present integer values (its a count, so it's obvious there can't be any non-integer values).  Currently it's set to auto select the range and the number of divisions, for which the range it's ok but the divisions don't always come out as all integers.  From what I can see, the only way to do this would be to set the min to 0, max to the max count on the report (which is normaly what the auto range does), and the number of divisions as the max count minus one.  I don't really see any other way.  Apparently there's no way to do this dynamically (like in a formula), and I don't think I can use static range values.  Is there any way to do this?  I just want to confirm what I know and see if there is any other way to do it.
    Also, this is probably not the forum to post this, but just in case, is there any way to do this programatically in code without needing extra libraries or extra tools?
    Thanks,
    Diego

    First of all, by static and dynamic data, do you mean the options for the chart?
    Also, I don't want to display the max count on the chart.  I would just like to use it on the options for the chart's Y axis as the max value, although I don't think I need to, since the auto scale already does that.  I think the only thing I should need is set the number of divisions to display on the Y axis.  For example, if the chart has two bars, one for lets say color red, and one for color yellow, and lets say on the data there were 4 red and 6 yellow.  So the chart will have two vertical bars, one for red going from 0 up to 4, and one for yellow, going from 0 up to 6.  The chart will automatically make the range on the Y scale go from 0 up to 6, but it might make the divisions at say 1.5, 3, and 4.5.  But I would like it to not use decimal values for those divisions, instead only divide the axis on integer values, like on 1, 2, 3, 4, 5.  To do that, from the options the chart gives me, I can do it by setting a specific number of divisions on the axis (in this case it would be 5 divisions).  I just want to know if there is any way I can set that in a formula or something, of if it just has to be the same value for every report (without having to change it directly on the Crystal Reports editor, because the reports get generated automatically with different sets of data).
    Thanks,
    Diego

  • Link in Word to Excel chart stored in SharePoint

    I want to embed chart from Excel in Word document. Both Excel and Word documents are saved in SharePoint library. What I did, was to paste chart from Excel with "link data" option enabled. I also went to Links window and set "Update method
    for seected link" to "Automatic update". 
    This works great, asking me to update chart everytime I open Word document, which is exactly what I want. Only as long as I have Excel file open. (I noticed, that when the file was on local PC, instead of SharePoint, it worked without opening Excel). When
    Excel is not open, chart is not refreshed. 
    If I go to Client Tools -> Design ribbon and click on Edit Data, source is opened in window and chart is updated. 
    My question is:
    How can I force chart to update with data, that might have changed in Excel located on SharePoint? Macro, that would open the file is fine. 
    Making users go thru ribbon and "edit data" option is unfortunately too complicated for inexperienced users. I need one-button-click solution or something that works automaticaly. 

    Hi Tschareck,
    According to your description , my understanding is that you want to update the excel chart data when editing the chart in the word.
    As a workaround, I suggest you can use SharePoint ItemUpdated Event Receiver, when you updated the chart data in the word, then reupload the excel file in the event receiver.
    Here are some detailed code demo for your reference:
    How to: Create an Event Receiver
    programmatically upload file to sharepoint list
    Best Regards 
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Zhengyu Guo
    TechNet Community Support

Maybe you are looking for

  • System Image Backup fails in Surface Pro Win 8.1 with an error

    I'm trying to create a system image backup by using "System Image Backup" tool that comes with Windows 8.1 without any success. For this I went to "File History" tool and under this at the bottom-left hand side there is a link "System Image Backup".

  • PSD-layered - copy and paste properties to layers in Motion?

    Hi, I imported a layered photoshop file into Motion. I applied certain properties to one layer (with key frames, such as rotate, scale, shadow...) and I want to know if there is a way to copy those properties and paste them onto the other layers so I

  • Mail content coming as Attachment too.

    Hi - While we are trying to send mails using SO_DOCUMENT_SEND_API1 , the mail content is coming as attachment . Can you suggest whats worng ? Thanks, sandhya

  • I get an error message that it is missing or in acessible

    I have windows 7 , I down loaded firefox and it worked for the first sesson , but now I get this error message .

  • Test-connection

    I am trying to write a script that tests three IP's in sequence (test-connection). If any of the three return TRUE (respond) then the script needs to end. If all three return false (don't respond) then execute a new set of powershell commands. I'm pr