Plot Secondary Y-Axis in Excel

I have two series of data and am trying to plot them to a primary Y-Axis and a secondary Y-Axis in Excel using ActiveX.  Right now I have a file in Excel that I am using to test my code that has the values 1 through 20 in the first three columns and is saved as test.xlsx in the filepath C:\Templates\test.xlsx.  I am able to open this file and plot the data in an XY scatter chart and name the primary x and y axes, but cannot figure out how to plot one of the data series against the secondary y-axis.
I created a macro in Excel and viewed the code it created to make a secondary y-axis.  This is the code:
Sub Macro1()
' Macro1 Macro
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.SeriesCollection(2).Select
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.SeriesCollection(2).AxisGroup = 2
    ActiveSheet.ChartObjects("Chart 1").Activate
    ActiveChart.SeriesCollection(2).Select
End Sub
When I try to do this with ActiveX, I can select SeriesCollection(2), but when I choose AxisGroup, it is only a read function and I cannot write a 2 to it.
Is there another way to plot one of these data series against a secondary y-axis.
Attachments:
test.vi ‏31 KB

The attached image was the way that I would have thought I was supposed to create the secondary axis by writing a 2 or xlSecondary to the AxisGroup, but it does not work because AxisGroup is Read Only and I cannot write to it.
http://msdn.microsoft.com/en-us/library/aa141701%28office.10%29.aspx
If I create a secondary axis using a macro, I can act upon that axis.  However, I am not able to create the secondary axis without a macro, which is what I would really like to do.
Ryan
Attachments:
ActiveX.jpg ‏9 KB

Similar Messages

  • How to bind the Zero line between a primary and secondary Y axis?

    All -
    We are using combination charts with:
    - primary and secondary Y axis (Sales versus Volume).
    - Scale: Auto (Y) Axis
    - Linear
    - Fixed Label Size
    In instances where one axis has a negative value and the value ranges are diverse the Zero line will be different for both. This causes some confusion when trying to read. Other that putting in manual (Y) axis with min and max, is there a way to force the chart to keep the same Zero line?
    Thanks!

    KOENIG Yvan wrote:
    It's quite a basic requirement for a spreadsheet program
    It's your point of view. It seems that it's not the designers's one
    Obviously, true
    The number of different features described once as "a basic requirement" is really amazing but a feature asked once is perhaps not one which must be added to a program like Numbers.
    Other tools are available for professional numbers crunchers .
    I know there are other threads asking about secondary axes, but your point is taken. I'm definitely not a number cruncher, but I am/was a pretty advanced Excel user.
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'09
    Thanks for that, I didn't quite know where to go for the feedback - provided and fingers crossed.
    Cheers!

  • Programmatically change primary and secondary Y-Axis range

    Ok, so the idea is that I have a chart with two different data types on it.  One is plotted on the primary Y-axis on the left side and the other is on the secondary Y-axis on the right side.  Both share the same X-axis.
    How do I change the range seperately for the primary Y-axis and secondary Y-axis?  Whats currently happening is no matter which "Active Plot" or "Y-Axis Index" I select, it only changes the range for the secondary axis.  Any help would be amazing!

    We are going to need to see some code to help with this.  and some clarification sinc a "Chart" cannot have multiple y axes
    Assuming you have an XY Graph this little code demonstrates how to set the scales min and max programatically
    Jeff

  • Problems in setting the Secondary y-axis caliberation

    Hi,
    I have a Business Graphics (Time-Scatter Graph) Application having 2 y-axis representing the sales volume. I have set the minimum value of the primary y-axis to 0 using the <b>default series</b>, but am unable to set the minimum value of the secondary y-axis value to 25. please help me in doing the same.
    Thanks

    Hi,
    have you set the minimum values using the chart designer? Just click on the second value axis node and set the minimum value to 25 (don't forget to set minimum calculation to user defined).
    Regards, Kai

  • Need to remove secondary Y axis scale numbers from Combination chart in Dashboard 4.0

    Hello all,
    I am using Dashboard 4.0 and combination chart. Earlier in combination chart, we had secondary Y axis and scale numbers on secondary Y axis. When I remove secondary Y axis and scale numbers, 0(min scale) and 1 (max scale) are not going off, they are still in the chart. How to remove them.
    Thanks,
    Renu

    Hi Renu,
    Instead of selecting data by Series, select the data by Range and map the data accordingly. Please follow the screen short for your reference.
    Regards,
    G.S.Ram.

  • Programmatically set data on secondary Y-axis

    I want to use property nodes and some other LV code to:
    1. Create a secondary Y-axis
    2. Take 3 1D arrays (t, f1(t),f2(t)) and use the t array for x values, with f1(t) on one axis as y values, and f2(t) on a secondary axis for more y values.
    This was pretty easy with just one curve (just bundle the two 1d arrays and wire the cluster to a graph), but adding this secondary Y axis has proven difficult. Any help is appreciated!

    It is easier to help you if you would show what you've done.
    Do you have problems forming the correct datatype for the second y values or are you trying to create a second Y scale and graph the second set of data there? What do you mean by "programmatically"?
    XY graphs take a wide variery of data types. Did youread the help and looked at some of the example in the example finder? How about the yellow version here?

  • Secondary y-axis

    can CFMX cfchart display a secondary y-axis on the right hand
    side of the graph? If so, how is it done.

    Yes it can be done. For this you should use an XML file in the style attribute in the cfchart. In that XML file place this code
    - <elements drawShadow="true" shapeSize="30">
    <movie framesPerSecond="40" />
    <morph morph="Grow" />
    - <series index="1" shape="line" isSecondAxis="true">
    <paint color="green" />
    </series>
    </elements>

  • How do I plot 3 Y-axis in Microsoft Excel?

    This is probably more of a VB question but I thought someone here may have had to do this as well. I'm using the Report Generation toolkit to present my data in Excel. I have setup a template and call a couple of macros to format the worksheet.
    Thanks

    Hi Dan,
    take a look in MSDN Library (Visual Studio 6) ... you can find each MS Chart method and property documented (even though I couldn't find anything about multiple Y axis).
    Good luck

  • How do I plot a y axis on the left and right in DIAdem/VIEW (version 11.0)?

    I am trying to analyze flight data, and I would like to analyze plots of certain parameters so that they share an x axis. It is necessary to view these using two different y axis, on the left and right. How do I do this in DIAdem (version 11.0) in the VIEW tab? Is this possible to do in the VIEW tab?

    myocom,
    You can highlight random points in DIAdem as well. 
    Here is an example:
    Use the cursor to move to the point you wish to highlight.
    Press the "Set Data Point and Flag" icon on each data point you wish to highlight
    When you are done selecting points, press the "Flags: Copy Data Points" icon - that will copy all X/Y coordinates into two new channels
    I created a REPORT Layout using the original data and the highlighted random points (I added the actual point Z-value above the point, they look strange when written at the exact point). I attached the layout for your reference.
    The complete task took 3 minutes from loading the data to finishing and exporting the REPORT layout. If you have a REPORT layout already, this will take less than 30 seconds ...
    I am not familiar with Matlab, so I can't compare how this works in DIAdem vs. Matlab. You can add the combine the complete process in a Script and it will automatically create this kind of report after simply selecting a few data points in VIEW and then pressing a button ...
        Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."
    Attachments:
    Report with highlights.zip ‏5 KB

  • Add label on y-axis and x-axis in excel using Report Generation toolkit

    Hello,
    I want to add label in x-axis(Date/Time) and y-axis(Temperature O=oC)
    There are only header and data array connection, how can i add label to the chart?
    Thank you.

    Hello,
    The way I've done this is by specifying the string inputs named "Column Header" and "Row Header" on the Excel Insert Graph.vi. This should provide the axis labels that you specify on your graph.
    Cheers,
    Emilie

  • Multiple plots on Y-axis

    I have multiple plots and how can I plot them with different depth on the Y-axis, Thks

    I followed the example and I could get the plots on different Y scales. However I always get the same plot stacked on the Y scale. See my source
    ReadMultiSampleAsync(samplesPerChannel, m_data);
    m_graphBeat.Plots.Item(
    "Plot-1").PlotY(CNiReal64Vector (m_data));
    m_data.Scale(1,1.0);
    m_graphBeat.Plots.Item(
    "Plot-2").PlotY(CNiReal64Vector (m_data));
    m_data.Scale(1,1.0);
    m_graphBeat.Plots.Item(
    "Plot-3").PlotY(CNiReal64Vector (m_data));
    Please help..

  • URGENT. Need to make plots with semilog-axis....HOW?

    URGENT. Is there any free classes/packages that are useful in plotting data?
    My plots should have semilog-axis, so that y-axis is logarithmig (intensity) and x-axis linear (time). There is no need for regressing or something like that, only points in the chart. Semilog-axis -feature is essential.
    I found a website: www.vni.com/products/imsl/jmsl_transition.html
    and it sounds promising, but I found no way to download the package!!!!
    I should also generate gif/jpeg/... image from that plot, but I think I can handle that...
    Thanks,
    krera.

    But it doesn't include semilog-axis.... (I think)JFreeChart does have a logarithmic axis feature. In version 0.8.1 only the y-axis can use a logarithmic scale.
    In the CVS version of JFreeChart (on SourceForge) there is now a corresponding feature for the x-axis too. This was contributed by one of the many developers that have submitted code to the project.
    Take a look at the displayTimeSeries2Chart() method in the JFreeChartDemo.java source file for an example
    of how to replace a standard axis with a logarithmic axis.
    Regards,
    Dave Gilbert
    JFreeChart Project Leader

  • Same plot with multiple axis

    What I want to do is plot time vs temperature with two y-axis. The first axis (on the left) is deg-C and the second axis (on the right) is deg-F. If I rescale one axis, I want the other to rescale accordingly. I tried plotting time vs deg-C, then computing time vs deg-F and plotting that too (see attached sub-VI). But then it looks like I have two plots! Is there some way to connect the two axis together so that, if one changes, then so does the other?
    Attachments:
    two scales problem.vi ‏12 KB

    You could use a property node for the XY Graph to set the maximum and minimum values of one of the Y scales based on another. You would read the maximum and minimum values of one Y scale, calculate the required max and min Y scale values for the other Y scale and then write these values using the property node. The property nodes you would need to look at are 'Active Y scale', 'Y Scale Maximum' and 'Y Scale Minimum'. Use the 'Active Y scale' to choose the Y scale to modify, and then use the 'Y Scale Maximum' and 'Y Scale Minimum' properties to set the required values. The image below describes how this looks like on the block diagram.
    I hope this helps!
    Vivek Nath
    National Instruments
    Applications Engineer
    Machine Vision

  • How to plot Dual Y-axis in BI Publisher chart

    Is it possible to plot dual axis in BI publisher chart?
    If I want to plot
    x-axis => Month
    y-axis(left) => Sales(in USD)
    y-axis(right) => Quantity
    how can I do in BIPublisher. Scale of Sales will not be suitable to plot Quantity.
    Please suggest.
    Thanks & Regards.

    for example : see seriesItems. and assignedTo
    <Graph seriesEffect="SE_AUTO_GRADIENT" graphType= "BAR_VERT_CLUST2Y">
    <Y1Axis axisMinAutoScaled="false" axisMinValue="0" axisMaxAutoScaled="true" majorTickStepAutomatic="true"/>
    <Y2Axis axisMinAutoScaled="false" axisMinValue="0" axisMaxAutoScaled="true" majorTickStepAutomatic="true"/>
    <LegendArea visible="true" position="LAP_BOTTOM"/>
    <PlotArea fillColor="#0000FF"/>
    <SeriesItems>
    <Series id="0" color="#B0C4DE" borderColor="#000000" markerType="MT_BAR" assignedToY2="false"/>
    <Series id="1" color="#0000C0" borderColor="#000000" markerType="MT_BAR" assignedToY2="false"/>
    <Series id="2" color="#B0C4DE" markerType="MT_MARKER" markerShape="MS_NONE" assignedToY2="true" lineWidth="0"/>
    <Series id="3" color="#0000C0" markerType="MT_MARKER" markerShape="MS_NONE" assignedToY2="true" lineWidth="0" />
    </SeriesItems>
    <LocalGridData colCount="{count(xdoxslt:group(.//G_1, 'MONTHANDYEAR'))}" rowCount="4">
    <RowLabels>
         <Label>Baseline (bar)</Label>
         <Label>Actuals (bar)</Label>
         <Label>Baseline cumulative (line)</Label>
         <Label>Actual cumulative (line)</Label>     
    </RowLabels>
    <ColLabels>
    <xsl:for-each-group select=".//G_1" group-by="MONTHANDYEAR">
    <Label>
    <xsl:value-of select="current-group()/MONTHANDYEAR"/>
    </Label>
    </xsl:for-each-group>
    </ColLabels>
    <DataValues>
    <RowData>
    <xsl:for-each-group select=".//G_1" group-by="MONTHANDYEAR">
    <Cell>
    <xsl:value-of select="sum(current-group()/BUDGET_VALUE_DELTA[.!=''])"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    <RowData>
    <xsl:for-each-group select=".//G_1" group-by="MONTHANDYEAR">
    <Cell>
    <xsl:value-of select="sum(current-group()/REVENUE_AMOUNT[.!=''])"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    <RowData>
    <xsl:for-each-group select=".//G_1" group-by="MONTHANDYEAR">
    <Cell>
    <xsl:value-of select="sum(current-group()/CUMULATED_SBP2[.!=''])"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    <RowData>
    <xsl:for-each-group select=".//G_1" group-by="MONTHANDYEAR">
    <Cell>
    <xsl:value-of select="sum(current-group()/ACTUAL_CUMULATED[.!=''])"/>
    </Cell>
    </xsl:for-each-group>
    </RowData>
    </DataValues>
    </LocalGridData>
    </Graph>

  • Plotting on 2y axis graph

    I have a CWGraph with 2Y axis style. I would like to plot two individual plots, each one with its own y-axis. I have added a second plot from the properties window and I have assigned Y-axis2 to it. What instructions should I use to plot each set of points for each y-axis. I've tried:
    m_graph.Plots.Item(1).ChartXY(time, voltage);
    m_graph.Plots.Item(2).ChartXY(time, current);
    but when I run the program, nothing appears on the plot window. Thanks in advance.

    Looking at your project, there are two issues that I see. The first is this:
    for(;
    m_graph.Plots.Item(1).ChartXY(time, voltage);
    m_graph.Plots.Item(2).ChartXY(time, current);
    time++;
    This is charting data in a very tight, endless loop. You'll notice that not only is the graph not updating, the entire application is not responding. This is because the application is not getting a chance to process windows messages, hence the UI does not get a chance to update. If you want to chart data continuously like this, you will need to either do it on a timer or pump messages somewhere in your loop so Windows messages can be processed.
    We can temporarily work around this problem f
    or demonstration purposes by changing the OnStart method like this:
    void CTestDlg:nStart()
    static double time = 0;
    double voltage = 2.5;
    double current = -10;
    // for(;
    m_graph.Plots.Item(1).ChartXY(time, voltage);
    m_graph.Plots.Item(2).ChartXY(time, current);
    time++;
    The intent of this change is that we can click the Start button and data will be added every time that we click. Now if you run the application, you'll notice that there's only one plot displayed. This is because the Y axes are a fixed scale from 0 to 10, but your plot that's displaying current (the second plot) is charting data that's out of range. You can fix this by either adjusting the fixed range of the Y axis that's associated with the current plot, or you can configure it to auto scale.
    Hope this helps.
    - Elton

Maybe you are looking for

  • Formatted Search with multiple conditions

    Hi experts, I am using a formatted search to update the Unit price in Sales Order. Query mentioned below. Select      T0.ItemCode,                T0.ItemPrice, From        ITM1 T0 inner join OPLN T1 on T0.PriceList = T1.ListNum Where      T0.ItemCode

  • Need Help with Simultaion for a Solar cell simulation

    hello, I want to simulate a Solar Cell in Multisim and i already entered the cirquit for a solar cell. However i have a problem with the simulation. i want to vary the load and the input power to see how the output voltage varys, as a function of inp

  • How to enter multiple values in BEX Analyzer 7.0

    We are on 7.0.  I created a query in Query Designer with a variable type of Select Option.  When I execute the query in BEX Analyzer, how do I enter multiple selections? Thanks. Ryan

  • GL account posting issue

    HI,     AT THE TIME OF GOODS RECEIPT WE  R GETTING TWO G/L ACCOUNT ENTRY 1)material account(qtyrate14%excise) 2)GR/IR account.(qtyrate14%excise) My problem is that in material account why is it calculating 14% excise.

  • Firefox 30.0 will not open profiles on my server, only local ones. (Ubuntu 14.04 LTS)

    I get the dreaded "Profile in use" error any time I try to open a profile that's stored on my network attached file server (it works fine for locally stored profiles). I get this only under Ubuntu 14.04. I'm also running FF 30.0 under Windows (includ