Axis scaling in labwindows for excel graph

I'm plotting an excel scatter graph onto my user interface with activeX controls. I have tried to use the SetChartAxisAttribute function from Excel Report to set the minimum values on the graph and specify the exact type of graph that I want, but the function does not seem to work. Does anyone know why this is happening?

Ive tried it a bunch of different ways, but here is what I have right now
ExcelRpt_GetWorksheetFromIndex(workbookHandle,1,&rawDataWorkSheetHandle);
ExcelRpt_SetWorksheetAttribute(rawDataWorkSheetHandle,ER_WS_ATTR_NAME,"Analysis Data");
ExcelRpt_WriteDataFromTableControl (rawDataWorkSheetHandle, location,
                                            panelHandle2, PANEL2_TABLE);
ExcelRpt_ChartAddtoWorksheet (rawDataWorkSheetHandle, 0, 0,
                                                   7.0*69, 4.0*74, &chartHandle);
ExcelRpt_SetChartAttribute (chartHandle,ER_CH_ATTR_CHART_SIZE_WITH_WINDOW,0);
location = "A2:K42";   
ExcelRpt_ChartWizard (chartHandle, rawDataWorkSheetHandle, location, ExRConst_GalleryXYScatter,
                                          ExRConst_Columns, 0, 0, 0, 1, "Data", "Z position", "Hall Probe", NULL);
ExcelRpt_SetChartAxisAttribute (chartHandle, ExRConst_Value,
                                            ExRConst_Primary,
                                            ER_CH_ATTR_MINIMUM_SCALE_IS_AUTO,
                                            ExRConst_False);
ExcelRpt_SetChartAxisAttribute (chartHandle, ExRConst_Value,
                                                          ExRConst_Primary,
                                                          ER_CH_ATTR_MINIMUM_SCALE,
                                                          100);
ExcelRpt_ChartSetSourceRange (chartHandle, rawDataWorkSheetHandle,
                                          location);

Similar Messages

  • Change scaling for a graph included in an HTML report

    I have an array included as a graph in a TestStand HTML report. It is a one dimesion array of 1000 elements. The array is filled by a custom 'C' code step (voltage reading from a Scope), based on the NI Example "DisplayArrayInReport". Is it possable to add or change the displayed X axis scaling in the report, from zero to 1000 (number of array elements) to, in my case, say zero to 10 and include a label of "Time mS".
    I am using TestStand Version 2.0.1

    I think it can be done!
    But you'll probably have to do it manually unless you feel like being CVI savvy enough to get into the source code for how TestStand builds HTML Reports (If you are, let me know and I can help you find where the function you need is)
    The report generator takes your array and passes it off to a DLL in charge of rendering it into a string that can be written to an html file. If you ever view the 'source' of your html report you'll see inside it is embedded a function call to:
    TSGRAPH1.PlotY()
    or something similar. I don't think this has changed from version 2.x to version 3.x. As far as I know there's no way to change the axis labels, but the function does have 3 fairly straightforward parameters, the array to plot, the Xo (origin) and
    the DeltaX. If you were to change the DeltaX from "1" to .01, and save the file, the next time you display it in your web browser the graph will look different.
    I doubt this is documented much of anywhere, so with luck a NI guy might see this and offer any other tips.
    Editing the CVI function call and rebuilding the DLL that generates this line of html would allow you to have those 'improved' parameters as part of your test sequence, but it might not be worth the bother.
    Cheers!
    Elaine R.
    www.bloomy.com
    Cheers,
    Elaine R.
    www.bloomy.com

  • Excel Graph Axis Title

    Hi all,
    Is there a way of naming the axes titles of an excel plot created using the Report Generation Toolkit? There does not seem to be such an option in the excel specific functions of the toolkit... Could it be done through activeX?? I tried to follow the suggestions in the link below but no luck...
    http://forums.ni.com/t5/LabVIEW/labview-excel-2007​-Axis-title/m-p/1226794/highlight/true#M521825 
    Thanks a lot for your time..
    Harry
    Solved!
    Go to Solution.

    Hi,
    I have attached a VI incl. many useful active-x commands for plotting graphs to excel. It is a large VI but it includes what you are looking for.. Scroll to the right and locate the 8th active-x box called chartwizard. This is what you are looking for. I have added constants indicating were the name of each axis goes in the wizard box. If you are not familiar with the rest of the active x commands just follow the sequence and you'l' be able to plot an excel graph fully customised through labview.
    Hope it is of help
    Harry
    Attachments:
    Excel_ActiveX_O2.vi ‏51 KB

  • How to insert the value axis in a EXCEL graph

    Hello,
    how can I do to insert the value axis (name) and graph tilte in a EXCEL graph using report generation in LabVIEW??
    I'm using excel specific functions, but I don't find it anywhere.
    THANKS.

    Hi,
    the function Excel Set Graph Font.vi has an input parameter called Title that corresponds to the name of the axis selected through Axis Type parameter.
    And the funtion Excel Insert Graph.vi has an input parameter called Graph Title.
    You can see an example called Column Graph (Excel).vi in Find Examples>Toolkits and Modules>Report Generation.

  • Specific Excel graph question for Indesign

    Hello,
    I have a question about how to use an image generated on Excel for mac for Adobe Indesign CC. I have browsed the forums here and googled but I'm not finding solutions for my specific question (so please bear with me, thanks). I have a report for work that requires a lot of bar graphs. The graphs are all done on Excel for mac 2011. I have tried two different ways of importing it into InDesign (also for mac) - 1) saving the graph as a PDF and then placing into InDesign, and 2) copying and pasting the Excel graph into Illustrator and then saving it as an ai file. In both cases, the ai file looks a bit better but the fonts seem a bit jarbled/compacted once I place it into InDesign. The font I use is Times New Roman. Also, since my report is laid out in a 2-column format, I need a chart to fit a space that is approximately 3 inches by 3.5 inches. Whenever I import the image, it’s significantly larger so I place it to fit the 3x3.5 inch space proportionally. When that happens, the fonts don't look quite right on the screen. I need to ensure that the chart looks sufficient once it’s printed on paper. I only recently began learning InDesign (self-taught) so your advise is appreciated.

    First, the preview may be at a lower quality, so see how it looks with View > Display Performance > High Quality Display set. Second, ID always displays some sort of preview on screen, but uses the actual image data for output, so export a page to PDF and print it to judge the quality.

  • Trying to create and excel graph and having trouble finding properties and methods for active x.

    I am trying to use Active X in labview 7 to create an excel graph and the HasMajorGridlines property for charts is not in my menu. Where can I get this property and others that appear to be missing and what is a good resource (looking for anything, especially books) for for using activeX/Labview/excel together?

    I am not sure if there is a book or tutorial how to use excel with LabView. I ncluded a Vi which gives you access to the HasMajorGridlines property. I hope it gives you the clou how to work with excel obejcts...
    Chris
    Attachments:
    excel_example.vi ‏24 KB

  • How to set 2 Y-Axis on a Excel Graph

    I am trying to make an excel XY plot with 2 y-axes, I am using report generation VI's for this program. Can any body tell me what VI I have to use and what property I need to set to have 2 y-axes on the excel graph.
    thank you.

    I apologize for the link above not working. Please see the attached file, which the above link would direct you to.
    Attachments:
    Using_Macros_in_Excel_with_the_Report_Generation_Toolkit.zip ‏57 KB

  • EXCEL GRAPHS SHOWING DATA FOR SAP

    ANYBODY KNOW ANY FUNCTION CALL TO EXCEL GRAPHS SHOWING DATA FOR SAP

    Hi,
    Please don't use all Caps in Subject and Body Text too
    Please have a look at [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Best Regards,
    Faisal

  • Modify x-axis display of an excel graph

    Hi,
    I'm want to use the excel report structure in LabVIEW.  I want to format the graph so that only the start and finish values appear on the graph in excel.  There doesn't appear to be a VI to do this. I also checked LabVIEW 8.5\examples\office\MSGraph Examples.llb but could not find this feature.
    Does anyone know if there is anyway that I can do this using LabVIEW?
    Thanks Sean

    So I guess the short answer is that LabVIEW does not have a VI to do this.
    I tried the following macro:
    Sub fun2()
        ActiveChart.Axes(xlCategory).Select
        With ActiveChart.Axes(xlCategory)
            .TickLabelSpacing = 1000
            .TickMarkSpacing = 500
        End With
    End Sub
    I works fine with a graph created in excel but doesn't work with the one created by the LabVIEW VI's. 
    Unfortunately I am not an expert at VB macro's or indeed why LabVIEW is formatting in a strange fashion.  
    Are the LabVIEW VI's useless?  Is it better to create ones own macro to create an excel graph?  I've wasted a lot of time so far but if anyone has any ideas I'd be delighted to hear them.  
    Plan B is to create a template with the graphs already formatted and insert the numbers.  I don't want to do this the template is very big and time consuming to open  but in the absence of a better solution.....

  • Vertical axis scaling problem with XYZ bar/line chart

    Post Author: satwar
    CA Forum: WebIntelligence Reporting
    Is there a trick to making the scaling on the
    Z-axis equal to the Y-axis. I don't want to specify the scaling on
    either axis because I am generating report with filtered "dimensons" in
    order to generate all measure charts for a given set of filters. The
    measures have various value ranges so by not specifying chart scales,
    the Y-axis is auto ranged, which is good, but so is the Z-axis, which
    is bad. I want both Y & Z axis to range together so I get a good
    visual comparison of the two measures being plotted.

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    satwar,
    There is no "trick", we're just victims of the limitation that WebI has in portraying XYZ type charts to our better liking.  I submitted a request to Business Objects Tech Support in Oct 2006 and became the proud holder of two ADAPTs:
    ADAPT00676587 u2013 for the scaling issueADAPT00676609 u2013 for the stacked bar chart, line graph issue
    When fully implemented, the scaling for Y and Z should be able to correspond to each other.  For instance, max value of Y and max value of Z will set on both scales the same max value.  I don't discourage you from submitting a trouble-ticket, perhaps if they get more noise on this situation they'll resolve my (our) ADPAT sooner, but just hoping....

  • PlotXY manual X Axis Scaling doesn't rescale Y-Axis auto-scaling

    I'm using PlotXY(..) to display data on a graph.
    I use SetAxisScalingMode(...) to set set VAL_LEFT_YAXIS to VAL_AUTOSCALE.  
    I use SetAxisScalingMode(...) to set set VAL_TOP_XAXIS scaling to VAL_MANUAL.
    I make various calls to SetAxisScalingMode(...) which change the min & max values for the X-Axis.
    Everything thing seems to display correctly except that changing min & max values using manual scaling on the x-axis does not seem to change the range of data used to auto-scale the y-axis.
    For example say you have a peak in your data that you want to exclude so the auto-scaling on the y-axis will zoom in.
    So you change the max, min manual x-axis scaling to leave out the peak but scaling but the y-axis scaling doesn't change.
    Is this the way it should work?
    Ideas for a work around?
    Thanks,
    Kirk

    Hi Kirk,
    As you've noticed, the autoscaling of an axis in the graph is based on the entire data of each plot, not just on the portion of the plot that is within the range of the other axis.
    If you use only integer limits for the min and max of the x axis, if you plot only 1D arrays, and if you don't mind re-plotting every time that you want to manually change the x-axis, there's a possible workaround, consisting of replacing PlotY with PlotWaveform, so that you can offset the data to plot.
    I've adapted the code that you attached earlier to illustrate this:
    int xmin = 40;
    int xmax = 90;
    SetAxisScalingMode(handle, PANEL_GRAPH, VAL_BOTTOM_XAXIS, VAL_MANUAL, (double)xmin, (double)xmax);
    PlotWaveform (handle, PANEL_GRAPH, datapoints + xmin, xmax - xmin, VAL_DOUBLE, 1.0, 0.0, xmin, 1.0,
                  style, VAL_EMPTY_SQUARE, VAL_SOLID, 1, color);

  • Looking for multiple graph logging suggestions

    I have a "host program" that is attached to a cRIO platform used for precision controlling of some heavy machinery.  The current host is used to set parameters, but primarily to read values and display trends for the operators and maintenance personnel.  I had previously been looking for a method to put a correct timestamp on my historical charts, which allow the user to scroll back if something odd occurs, but this has become more trouble than it is worth.  One of my main difficulties in all of this is that I have 6 synchronized graphs that need the "roll back" ability, and putting a live timestamp on a chart you must be able to pause and rewind is unfathomably difficult with LabVIEW...
    So, I have decided to kill 2 birds with 1 stone, so to speak.  I needed to work out logging the graphed signals to file anyhow, so I decided I might as well just do this and externally reference the log files for the "rewind" functionality.  My problem now is finding the best approach to log these 6 graphs of differing types...  The first graph has 3 overlaid analog values, the second graph has 2 overlaid values, and the last 4 are each just a single individual (scaled) sensor reading.  The graphs are updated every 100ms.  Accurate timestamps (date and time) need to be attached to the data as well.
    This logging is a new arena of LabVIEW for me, but I figured there has to be at least a few experienced users or developers out there who know all of the ins and outs.  Any suggestions on the best way for me to log this data?  Individual files for each chart, or is there a better method to combine the data to keep it cleaner (not multiple files to track)?  Are there pitfalls I should be watching out for?

    Take a look at tdms files.  They are a binary format that is open (www.ni.com/white-paper/5696/en).  You can define groups of channels and they can be logged at different rates.  The LabVIEW API makes it relatively easy to retrieve a channel or group, although it may be more challenging to find a specific time if your files are large.  Besides the examples included with LabVIEW, you can drill down into the TDMS File Viewer that's in the TDMS palette for another example.  Also, there is a plug in for Excel that will allow it to import TDMS files (zone.ni.com/devzone/cda/epd/p/id/2944).

  • Charts data axis scaling problem

    Post Author: rameshp
    CA Forum: Charts and Graphs
    Hi ,
    I work on crystal reports XI.
    I'm facing problem regarding scaling data axis. I have illustrated that in the following lines:
    case1) if i have high values (sum of bytes) like more than 600 etc. its scaling data axis from 0 to say 1000.
    case 2) if i have low values like 0,1 (bytes)   then its scaling from -4 to say 6 .
    I don't want negative values on data axis .  I want from 0 to max. So what's the better way to do this using chart expert.
    Your suggestion is highly appreciated !
    Thanks,
    Ramesh.

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    satwar,
    There is no "trick", we're just victims of the limitation that WebI has in portraying XYZ type charts to our better liking.  I submitted a request to Business Objects Tech Support in Oct 2006 and became the proud holder of two ADAPTs:
    ADAPT00676587 u2013 for the scaling issueADAPT00676609 u2013 for the stacked bar chart, line graph issue
    When fully implemented, the scaling for Y and Z should be able to correspond to each other.  For instance, max value of Y and max value of Z will set on both scales the same max value.  I don't discourage you from submitting a trouble-ticket, perhaps if they get more noise on this situation they'll resolve my (our) ADPAT sooner, but just hoping....

  • Excel Graph Legend Formatting - Report Generation Tool

    Hi all,
    I'm currently using the Report Generation Tool for Labview '11 and cannot seem to figure out how to edit the font properties for a graph's legend. Attached is a screenshot of an example output.
    The Excel Graph Font.vi's Help file says that it should be able to modify the legend, yet I can't seem to figure out how to configure it to do so. If anyone can walk me through the steps or tell me what I am missing, I'd greatly appreciate it.
    Solved!
    Go to Solution.
    Attachments:
    excelLegend.png ‏33 KB

    ChaoyD wrote:
    Hello again,
    It seems my team has decided to change direction and use Word instead of Excel. As such, I've been attempting to convert the VI ben64 provided, but I'm stuck on the ActiveX references... I've attached what I've done so far, but could someone help me (or instruct me) on making this VI work with Word?
    Thanks.
    The Word object model is probably the most complicated of the Office suite and you are loosing the calculation ability of Excel.
     Attached is a vi to format the chart legend in a Word document.
    Ben64
    Attachments:
    Word Format Graph Legend.vi ‏26 KB

  • 2D Axis Scaling Bug in Reports (DIAdem 2014)

    Hello,
    I've run across a rarther annoying bug in the 2D axis scaling for Reports.  Here's how to recreate it:
    Load a dataset that has x and y components.
    Create a new layout in the Report tab
    On Sheet1, add a Simple 2D Axis System.
    Select x and y from the dataset and drag it into the 2D axis system.
    Change the scaling mode from "Completely Automatic" to "Manual."
    Change the "Begin" number to something close to the default DIAdem has set.  Do not touch the "End" number.  Click OK.
    Add Sheet2 and repeat steps #3 thru #6 on Sheet2 with a different dataset.
    Both plots look good right now...
    Go to Sheet2 and double click on the chart to bring up the Curve and Axis Definition.
    Don't touch anything...just click "Cancel."
    After clicking Cancel, the scaling of the 2D axis completely changes.  I believe what happens is that DIAdem takes whatever the previous "End" number was and uses that instead of the "End" number you want.  Also, you don't actually have to go into the Curve and Axis Definition to create this bug.  Press cancel while editing anything like text (for example)...bye bye plot.
    Moreover, if I go back in and set the scaling mode back to Auto, click preview to refresh the plot, then switch the mode to Manual, everything looks good.  However, if I copy Sheet2, the plot on Sheet2_Copy1 is messed up the same way as if I hit Cancel but Sheet2 is OK.
    Worst of all, the undo function does not work on this unwanted scaling change.
    This is a bug that makes plots in the Report files almost unusable.  I hope this is re-producable on other systems so a patch can be issued.  Let me know what you find.
    The only workaround I've found is to click OK instead of Cancel, which isn't always preferred.
    Thanks,
    Jacob
    Solved!
    Go to Solution.

    Hello jrasco,
    You are right. This is a bug in DIAdem 2014. We fixed it for the DIAdem service pack.
    This is the link to the English DIAdem 2014 SP1
    Thank you
    Walter

Maybe you are looking for