Producing a line graph of int values and saving as an image

Hi,
I wonder if anyone could help me with this. I have 2 arrays of integer values that I would like to plot as a line graph (e.g. X[ ] and Y [ ]) and then have this line graph saved as an image (the format isn't too important but PNG would be preferred).
Could somone point me in the right direction of an easy way to do this?
Thanks,
Pete

Have a look at the following classes :
java.awt.Graphics (drawLine method)
java.awt.Image
java.awt.BufferedImage
javax.imageio.ImageIO (jdk 1.4+)

Similar Messages

  • Get every 10 sec a int.value and need to take the sum of the last 18 values

    Hi,
    i get every 10 sec a int.value and need to take the sum of the last 18 values (3 minutes).
    the programm should work permanently.
    I tried with a 1d-array but didn´t get a result. Could anyone help me?
    Best regards
    kasche

    Use the example in the posted link, then add another shift register for your sum of all elements. Dont add all the elements every time, add them to a running total when they come in. You will need to evaluate how big this number is going to get, however, and decide if you should use an I64 for your running total of all elements. Even this will overflow eventually. 
    So your code would look like that posted by GerdW in the above link, then add a shift register with a starting value of 0. Then add your input value to the value comming from this shift register and send the output to the shift register's output terminal. This creates your running total of all values. The code by GerdW provides your "last 18 elements" total in a very efficient manner, just change the 15 to an 18.
    I have attached a sample bit of code to make it clear. I saved it in LV 8.0 so more people can open it.
    CyberTazer
    Software Systems Engineer
    Attachments:
    Running 18 total.vi ‏11 KB

  • Creating multiple Line Graph having common values..

    Hi...
    I've created one application process for creating Multiple Line Graph.
    And i've integreted two tables in this graph, where values may be common for both the tables. In this case, for common values, instead of getting overlapped I'm getting scattered graph(its totally abnormal). Please help me if you 've any idea about this issue.....?
    Please go through the App Process and the output of the SQL query.
    In output of the query, in the NAME column "Feb-2010" is common.
    This is the SQL query OUTPUT:_
    TABLE 1
    NAME VALUE
    Sept-2009 100
    Oct-2009 95
    Nov-2009 98
    Feb-2010 97
    TABLE 2
    NAME VALUE
    Jan-2010 93
    Feb-2010 100
    Mar-2010 98
    Application Process :_
    DECLARE
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    OWA_UTIL.http_header_close;
    HTP.p ('<?xml version = "1.0" encoding="utf-8" standalone = "yes"?>');
    HTP.p ('<anychart>');
    HTP.p ('<settings>');
    HTP.p ('<animation enabled="True"/>');
    HTP.p ('</settings>');
    HTP.p ('<charts>');
    HTP.p ('<chart plot_type="CategorizedVertical">');
    HTP.p ('<data_plot_settings default_series_type="Line">');
    HTP.p ('<line_series>');
    HTP.p ('<marker_settings>');
    HTP.p ('<marker type="None" />');
    HTP.p ('<states>');
    HTP.p ('<hover>');
    HTP.p ('<marker type="Diamond" />');
    HTP.p ('</hover>');
    HTP.p ('</states>');
    HTP.p ('</marker_settings>');
    HTP.p ('<tooltip_settings enabled="True">');
    HTP.p ('<format>Year {%Name}{enabled:false} {%SeriesName} - {%Value}{numDecimals:0}%</format>');
    HTP.p ('</tooltip_settings>');
    HTP.p ('<effects enabled="True">');
    HTP.p ('<drop_shadow enabled="False" />');
    HTP.p ('<bevel enabled="true" distance="1" blur_x="2" blur_y="2" />');
    HTP.p ('</effects>');
    HTP.p ('<line_style>');
    HTP.p ('<line thickness="3" /> ');
    HTP.p ('</line_style>');
    HTP.p ('</line_series>');
    HTP.p ('</data_plot_settings>');
    HTP.p ('<chart_settings>');
    HTP.p ('<title enabled="true">');
    HTP.p ('<text>Avg. %App. Uptime per month </text>');
    HTP.p ('</title>');
    HTP.p ('<axes>');
    HTP.p ('<y_axis>');
    HTP.p ('<title>');
    HTP.p ('<text>Value</text> ');
    HTP.p ('</title>');
    HTP.p ('<scale minimum="90" maximum="101" major_interval="1" />');
    HTP.p ('<labels>');
    HTP.p ('<format>${%Value}{numDecimals:0}</format>');
    HTP.p ('</labels>');
    HTP.p ('<axis_markers>');
    HTP.p ('</axis_markers>');
    HTP.p ('</y_axis>');
    HTP.p ('<x_axis tickmarks_placement="Center">');
    HTP.p ('<title enabled="False" /> ');
    HTP.p ('</x_axis>');
    HTP.p (' </axes>');
    HTP.p ('</chart_settings>');
    HTP.p ('<data>');
    FOR ObjRecord IN (select DISTINCT(K_OBJECT.OBJECT_ID) as OBJECT_ID,name from K_OBJECT, K_OBJ_TYPE_ASP_REL where K_OBJECT.OBJECT_ID=K_OBJ_TYPE_ASP_REL.OBJECT_ID and K_OBJ_TYPE_ASP_REL.OBJECT_TYPE_ID=1)
    LOOP
    HTP.p ('<series name="'|| ObjRecord.name ||'">');
    FOR MonthlyValueRecord IN (select NAME,VALUE
    from K_REPORT_RUN,K_ASPECT_VALUES,K_ASP_TIM_RPT_REL
    where K_REPORT_RUN.RUN_ID=K_ASP_TIM_RPT_REL.RUN_ID
    and
    K_ASPECT_VALUES.ASPECT_VALUE_ID=K_ASP_TIM_RPT_REL.ASPECT_VALUE_ID
    and
    K_ASP_TIM_RPT_REL.ASPECT_ID=1
    and
    K_ASP_TIM_RPT_REL.OBJECT_ID=ObjRecord.OBJECT_ID
    order by K_REPORT_RUN.STARTTIME)
    LOOP
    HTP.p ('<point name="'|| MonthlyValueRecord.name ||'" y="'|| MonthlyValueRecord.value ||'" />');
    END LOOP;
    HTP.p ('</series>');
    END LOOP;
    HTP.p ('</data>');
    HTP.p ('</chart>');
    HTP.p ('</charts>');
    HTP.p ('</anychart>');
    htmldb_application.g_unrecoverable_error := true;
    END;
    Edited by: user12873839 on Apr 9, 2010 3:58 AM
    Edited by: user12873839 on Apr 9, 2010 4:02 AM
    Edited by: user12873839 on Apr 9, 2010 8:00 AM

    >
    Help Needed Urgent.....
    >
    That is one surefire way to not get any help and certainly not urgently. I suggest that you amend the title of your post to something that reflects the actual issue. This will also help anyone with similar issues to find the thread.
    When posting code please put {noformat}{noformat} (with the curly brackets and the word code in lower case) above and below it to preserve formatting like this...
    {noformat}{noformat}
    SELECT *
    FROM emp
    {noformat}{noformat}
    This will be displayed on the forum like this...SELECT *
    FROM emp
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Line Graph  X-axis Value

    Hi ,
    I Created line graph in ADF X axis - date , Y axis Amount and Currency Mixed Frequency Line graph
    For ex : X - axis dates are 01-jan-2011 to 10-jan-2011
    y - axis are amount and currency
    when i click particular currency line (on 05-jan-2011) how i will get the x axis value 05-jan-2011
    Thanks
    Shk

    Check the range against which line is plotted, you may have to reduce that range to see accurate values.

  • Line graph with single values as dots

    Dear Apex experts,
    I have the requirement to create a graph in Apex which displays technical values as dots or candles and limit values and average values as lines in one graph.
    Is there a way to create two types of graphs in one image ?
    Best regards,
    Daniel

    Hi,
    as far as I know, you can't have interruptes series in the DVT line graph
    Frank

  • Line graph for population(billions)  and years HELP!

    I have a homework assignment, and I need to use a line graph, to graph the stats below. When I try and do this in Numbers it is giving me one line for the year and one line for population. What I want is ONE line going from 0.3, 0.31, 0.5... but I want those numbers on the graph to match up with the corresponding year, so those numbers would go with 1000, 1250, and 1500.
    If someone could provide step by step instructions I would really appreciate it.
    Thanks,
    Brandon
    Year Population (billions)
    1000 0.3
    1250 0.31
    1500 0.5
    1750 0.79
    1800 0.98
    1850 1.26
    1900 1.65
    1950 2.52
    1960 3.02
    1970 3.7
    1980 4.44
    1990 5.27
    2000 6.06
    2010 6.79
    2020 7.5
    2030 8.11
    2040 8.58
    2050 8.91

    To achieve that, the column containing the year values must be a header one or the cells must be formatted as TEXT.
    Yvan KOENIG (from FRANCE lundi 9 février 2009 12:00:59)

  • Sorting array double or int value and keeping the associated identifier.

    Hi,
    How would I sort an array which contains a double or int value (I know how to do that) but I also want to keep the unique identifier which is associated to array element after the array has been sorted:
    example:
    identifier: 15STH7425042735
    double: 742500.000
    Thanks,
    John J. Mitchell

    Please define an it in form of entity first and then think of operating on structured data.
    a better approach here would be please create an instances of appropriate structured data arrange them in form of a list and then apply specified logic on them
    here is an example which you might think of implementing it and would more appropriate as per your stated requirements.
    public class SampleBean implements Serializable{
       private String uniqueIdentifier = new String();
       private double appValue = 0.0;
       public void setUniqueIdentifier(String uniqueIdentifier){
           this.uniqueIdentifier = uniqueIdentifier;
       public String getUniqueIdentifier(){
          return this.uniqueIdentifier;
       public void setAppValue(double appValue){
              this.appValue = appValue;
       public double getAppValue(){
            return this.appValue;
    }Sample Comparators:
    Comparator comparator4AppValue = new Comparator(){
          public int compare(Object obj1,Object obj2){
                  return Double.compare(((SampleBean)obj1).getAppValue(),((SampleBean)obj2).getAppValue());
    Comparator comparator4UniqueIdentifier = new Comparator(){
          public int compare(Object obj1,Object obj2){
                  return ((SampleBean)obj1).getUniqueIdentifier().compareTo( ((SampleBean)obj2).getUniqueIdentifier());
    };Assuming that you have acquired an Array or List 'N' Elements of SampleBean with appropriate values.
    the belows is the method of how to sort specified Array/List
    In case of array
    SampleBean sb[] = this.getSampleBeansArray();
    // in order to sort using double value inside SampleBean array.
    Arrays.sort(sb,comparator4AppValue);
    // in order to sort using unique Identifier value inside SampleBean array.
    Arrays.sort(sb,comparator4UniqueIdentifier);In case of a list
    List sb = this.getSampleBeansList();
    // in order to sort using double value inside SampleBean array.
    Collections.sort(sb,comparator4AppValue);
    // in order to sort using unique Identifier value inside SampleBean array.
    Collections.sort(sb,comparator4UniqueIdentifier);Hope this might give you some idea of how to go about.:)
    REGARDS,
    RaHuL

  • Character, int value and radix

    I'm iterating through strings testing for ASCII characters > 127 (e.g. in MS Word, typing in "..." creates a single character of 3 dots (ASCII 133)).
    When I use Character.digit(char, radix) and a character > 127 is found, -1 is returned. But I need to find out what the ASCII value is when it's > 127. I'm not clear on how to use the radix value and my searches on the web have only made it murkier. Anyone who can help me clear this up would be greatly appreciated.
    Thank you
    Tom Berry

    I want to find the actual ASCII value to remap it to a usable ASCII character(s) < 127. For example, type 3 periods "..." in MSWord. It will automatically change to ASCII 133. When a user cuts and pastes text from MSWord to one of my web apps, and the data is saved to SQL Server, any of these 'MS' characters > 127 becomes a "?" when it is retrieved and displayed on a HTML page. I'm trying to intercept this text and correct the characters.
    I'm currently doing the following:
    a. Character.getNumericValue(char) == -1,
    b. Create a new Character object of the char,
    c. The method .hashCode() gives me the Character's ASCII value,
    d. If > 127 (CR, LF, SPACE, etc are also caught in this), I pass the ASCII value to a HashMap which returns the correct character.
    This seems to inefficient. I was hoping to be able to get the ASCII value at step a. and so not be creating new Character objects each time the NumericValue == -1.

  • Drop shadow on eps shape produces fine line when inserted into InDesign and PDF created.

    Hi I am having a few issues with an eps file that I have created. Basically it is a eps file with shapes, a gradient and a drop shadow on the outlined text - created in illustrator.
    All looks fine until I take it into Indesign and create a pdf. I then get a line around where the drop shadow is. Zooming in doesn’t make it go away, but it also does not change its size.
    I have done some research and tried one fix (have the drop shadow as another object using multiply as the opacity) this did not work.
    Anything else talks of spot colours (there are none) or just having view ok on the screen (take off smoothing). But none of these are fixes for when I send this image to my client. I also tried saving as different pdf formats but this also does not work.
    The only way I can make it go away is to save the file as an illustrator ai file and use that for pdfs. This would be OK, but other suppliers need to use the file and want eps format.
    From what I have read, it seems to be a screen artefact and so theoretically should not appear when printed. But I do not know this for sure and I hesitate to send it to the client as it is.
    Has anyone seen this before? And are there any fixes (e.g.: treating the drop shadow differently)?
    Thanking you in advance.
    Cheers
    Nikola

    NViereckel schrieb:
    The only way I can make it go away is to save the file as an illustrator ai file and use that for pdfs. This would be OK, but other suppliers need to use the file and want eps format
    EPS is simply unsuitable when dealing with transparency (which is what your drop shadow is). So you need to work with AI for placing in InDesign. If other suppliers need EPS, then just send them that. Nothing should keep you from exporting another file format.

  • Changing Variable values and saving it across sessions.

    Hi,
    I've have an requirement like counting the number of times a form is opened and number of times a button is clicked.For this I tried to use global variables.I tried to increment the value of the variable each time a form is opened or a button is clicked.
    opencount.value += 1;
    But it didnt work for me.I tried to hardcode a value like
    opencount.value = 5;
    Even this is also not working.Do I need change any settings or extend rights.Is it possible to save the values that are persistent across the sessions.
    Please help

    I have another apporach using an extras object.
    What you is a script object 'Actions' with this script, to create a counter in the extras object in any form object.
    function initOpenCounter(targetObject) {
        if (targetObject.extras.nodes.namedItem("OpenCounter") === null) {
            targetObject.extras.nodes.append(xfa.form.createNode("extras", "OpenCounter"));
            targetObject.extras.OpenCounter.nodes.append(xfa.form.createNode("integer", "state"));
            while (targetObject.extras.OpenCounter.nodes.length > 0) {
                targetObject.extras.OpenCounter.nodes.remove(targetObject.extras.OpenCounter.nodes.item(t argetObject.extras.OpenCounter.nodes.length - 1));
            var newState = xfa.form.createNode("integer", "OpenCounter");
            newState.value = 0;
            targetObject.extras.OpenCounter.nodes.append(newState);
    Then you need another script, to call the function in the script object and raise the counter, when the form opens.
    I used a floating field in a text on a master pager and put this script into its initialize event.
    Actions.initOpenCounter(this);
    var cCount = parseInt(this.extras.OpenCounter.nodes.item(0).value, 10);
              cCount += 1;
    this.extras.OpenCounter.nodes.item(0).value = cCount;
    this.rawValue = cCount;
    Here's a sample form with an open and save counter.
    https://acrobat.com/#d=C90OHrJKx52LHrtbtahWzQ

  • Read Instrument Value and Saving Data

    Hi Everyone,
    I have DSOX3014A Oscilloscope and  33521AQ Function / Arbitrary Waveform Generator . I want to make program that read oscilloscope and waveform generator data and send to tax file.
    What should ı do ?
    Thank for your time and attention.
    Solved!
    Go to Solution.

    I am really beginner.I never tried something so far.I have oscilloscope and arb generator. Also ı have piezoelectric bender(been attach) actuator resonance impedance.I connected oscilloscope and arb waveform generator to my computer. I want to record oscilloscope and arb waveform generator's data to tex file.
    Actually ı don't have impedance analyzer therefore ı calculate piezo bender's resonance impedance this way.
    Seem http://www.ni.com/try-labview/instrument-control/    first video but ı have to convert data to tex file. 
    What should ı do? 
    Thank You for your attention.
    Attachments:
    20150203_231732_Richtone(HDR).jpg ‏840 KB
    Capture.PNG ‏970 KB

  • TDMS Low level file functions and Saving Front Panel image

    Am using TDMS low level file functions to save while also plotting data in my data acquisition programme.  However, I also want to programmatically be saving the front panel image on every run of my data acquisition.  I have coded all other aspects, except the behavior of functionality of saving the front panel image on every successive runs of the application.  Unfortunately, I just have no idea on how to code this aspect on LabVIEW, and all effort to search for example codes on so far have not been successful.
    I would appreciate any useful hints or steps from anyone for me to follow, in order to accomplish this behavior, and that is being able to programmatically save my front panel images while using TDMS low level file functions in my File IO system of my application.
    Thanks in advance.

    Tebefia wrote:
    Am using TDMS low level file functions to save while also plotting data in my data acquisition programme.  However, I also want to programmatically be saving the front panel image on every run of my data acquisition.  I have coded all other aspects, except the behavior of functionality of saving the front panel image on every successive runs of the application.  Unfortunately, I just have no idea on how to code this aspect on LabVIEW, and all effort to search for example codes on so far have not been successful.
    I would appreciate any useful hints or steps from anyone for me to follow, in order to accomplish this behavior, and that is being able to programmatically save my front panel images while using TDMS low level file functions in my File IO system of my application.
    Thanks in advance.
    Did you see this link?
    CLA, LabVIEW Versions 2010-2013

  • Problems acquiring and saving multiple camera images using a switch with GigE cameras

    Hi Folks,
    We are having an issue with connecting 6 GigE cameras via an Ethernet switch. We can acquire and store individual cameras but once we increase the number of cameras we end up with jumpy avi files.
    Each camera has been physically labelled and attached to the switch, so camera 1 is attached to port 1, which then corresponds to Cam1 in MAX. When recording multiple files what appears to happen is that the avi file from cam1 actually has images from multiple cameras, as if cam1 is being renamed/allocated on each frmae and each time a different camera is allocated. How can we fix this?
    We are new to this so any help or advice would be much appreciated.
    Thanks in advance,
    Cathy
    Attachments:
    Camerad.png ‏60 KB
    Camera.vi ‏91 KB

    I think your problem is caused by using the same image name on each instance of Imaq create. "Grab and Save to AVI Acq" being the string you are using. I am pretty sure If you make each image name unique you wont get image referance problems.
    Senior Software Engineer
    www.Adansor.com

  • LIne Graph in JClient

    I do apologise in advance for asking a 'simple' question but I cannot work out how to produce a line graph in a JClient and I have found no examples/tutorials which do so .
    Here's what I do:
    I have a Stock table (STOCK_ID,NAME) and a Price table (STOCK_ID,DATE,PRICE).
    I create an empty JPanel and create a Stock Table (StockView1) on a JScrollPane and a Price table on another(PriceView2 under StockView1)).
    I create navigation bars for each.
    This coordinates and works fine.
    I then want to display a line graph x=date y=price for each stock as I navigate through the stocks.
    So I drag PriceView2 as a graph onto the JPanel.
    This causes a BIGraphDef1.xml and PriceView3 (seen under Panel1UIModel.xml) to be created.
    I open BIGraphDef1.xml and change the graph type to line.
    I then click on PriceView3 which opens the Customize Graph Binding dialog, Select Data Collection.
    Now I assume that I should select the 'Multiple Data Selection' radio button.
    I can then only progress to the next page 'Select Attributes' if I select StockView1 as the 'Data Collection' which defaults 'PriceView' as the 'Data Collection accessor'.
    Then whatever combination I try on that page I cannot produce a line graph - usually getting the 'insufficient number of columns' message.
    Should I be creating another view on the data?
    I'm sure the solution is simple, but obviously I have some sort of 'conceptual' problem ;(
    TIA
    Thanks in advance.

    Danny,
    as far as i know its not possible to have them dotted. However, beside of different line width you could use markers with different symbols that should do it.
    m_graph.setGraphType(Graph.LINE_VERT_ABS);
    m_graph.setMarkerDisplayed();
    m_graph.setMarkerShapeInLegend();
    You can customize the marker symbol on the individual series.
    Frank

  • Designing Line Graph

    Hi,
    How to get class file to design a line graph with multiple series and facility to set minimum and maximum values of y-axis. and I need applet code also

    Take a look at: http://www.jfree.org/jfreechart/index.html
    And if you need to do it from a JSP: http://cewolf.sourceforge.net/

Maybe you are looking for

  • Condition reports

    I have created few condition types, WCT for work contract tax, similar to this there are few other condition type. Now here i want a report on as "HOW much WCT has been paid in the year" for reporting purpose. Plz any one guide me as how to find repo

  • Default PR Type when convert from Planned Order

    Hi all, How can I default my PR Type when convert from Planned Order after MRP run. This can done via MRP Group control but how to go about controlling via Planned Order profile? Which planned object type and planned order profile to be used? assumin

  • Is there a way to take the code form my iweb site and put in into iweb on a different mac?

    I had built my website on an old laptop - the hard drive shattered - and yes i was bad and didnt back up..... I want to update my site - but i dont want to start all over  - i just want to make some changes and re publish - Can i get the current code

  • Performance management workflow appraisee and appraiser name to be passed in email

    I am working on the performance management workflow. When the manager chooses to require an employee self assessment then an email notification should be triggered to the employee (appraisee) notifying them of the self assessment to be taken.This is

  • Posts edited by host and removed

    Is there some reason my postings are being edited by host and removed from the discussions? Today I posted the following, and it was removed from the discussions. I have since added it back as it and all other posts I write are pertinent and directly