Creating Graphs from a JTable

Hello fellow coders, Im not too sure on how to implement a graph in swing and was looking for some help into creating a graph from a Jtable in my program. I have seen many suggestions to use JFreeChart, but i am not too sure how to use this. Any suggestions or help will be much appricated. There are duke dollars availiable for the most helpful reply.
Cellze

Yes i do mean a Chart with x,y co-ordinates - sorry should of been a bit clearer.
The problem i have had with JFreeChart is actually figuring out how to use it. It hasnt got any decent documentation that i have found.
I am using eclipse to code my program and have included the libraries into the build path but it has taken me a couple of days to get that far.
The libraries being the .jar files found in the \lib folder. Please tell me if I am completely incorrect the way i am doing this
If any one has used JFreeChart before in a similar way could you please forward the relevant documentation or tips to help me get started with this library. As it is so big and i am just stuck trying to understand it at the moment.
Cellze

Similar Messages

  • Create Graph in Jdeveloper...

    Hi! I created graph from table data in Jdeveloper, see: http://my.jetscreenshot.com/2677/20120126-sq6z-32kb
    As You can see, there is Legend, but in Legend are not visible all elements. What I need to change to see all elements in Legend and with full name? By the way it is possible to remove Legend, if yes, how?
    Best regards, Debuger!

    Hi, Suresh! I read the article, this was helpful. But I still have one problem. When I go to element "Pyrus bolleriana" in legend, then I can not see this element in my Pie diagram, see: http://my.jetscreenshot.com/2677/20120127-qysg-48kb In the Pie diagram I can see % for 30 records, but I have 48 records in table. Where might be the problem?
    Maybe the problem is that, I have only one element under dvt:seriesSet element? (please, see: http://my.jetscreenshot.com/2677/20120127-z33x-15kb)
    Best regards, Debuger!

  • Excel & ActiveX: Insert arbitrary columns from 2D array and create graph problems

    Hi there,
    I want to insert data from either a 1D or 2D array from LabView into Excel and create graphs.
    I used the information from the following example:
    http://www.ni.com/example/28934/en/
    and was able to create a new Excel file (I'm using Excel 2010), writing data from an 1D array to a column in excel by creating a while loop and using the first element of the array to write it to a specific cell. I use the counter of the loop to write to the next cell when the loop starts over and always delete the first value, which I write to the cell, from the array until it is empty.
    Now I also would like to write a 2D array - so the first column in Excel should be the first column from the array and so. Here I cannot use the loop counter directly as Excel only counts 1,2,... for the rows, but uses A,B,... to count columns. Also I do not know in advance how many columns my 2D array will contain, so creating a lookup table like (A means 1, B means 2,...) is not really an option (except there really is no other way). Is there a possibilty to convert numbers into letters or some way to 'explain' to the program that column 2 in the array means column B in Excel for example, or is there a way to insert new columns?
    I figured out how to add new Worksheets and as I also need to create a certain number of Worksheets and I know that on standard 3 sheets are present when creating the file, I use the 'add' methode to create every new worksheets before worksheet 3 - I could use the same methode to create new columns in Excel, but so far I didn't find a methode to do so. Or is there a way to enter the whole 2D array at once?
    Then I'd like to create a graph (in case of the 1D arrays a bar plot, when using 2D arrays a 3D plot) to view the data. I found this example:
    http://www.ni.com/newsletter/51339/en/
    -> as I do not have the toolkit I'd like to do it using ActiveX directly, so I tried to do things like shown under the headline 'DIY ActiveX/.NET'
    I tried to load the snippet to a new Excel file but got the error message 'microsoft.office.interop.excel.dll not found' and hence the code is not working. That confuses me a little as I would guess when this dll is not present I cannot access Excel from LabView at all, though my understanding of what I'm really doing so far is quiet limited. ;-)
    Also - as far as I understand from the snippet - when creating a new chart object I should be able the create methodes for it, however when I do a right click on the chart object of an ActiveX Worksheet symbol there are none listed.
    To explain my problems better I added a snippet showing my two problems: The inner of the two while loops shows how I import a 1D array. In the outer loop I seperate the columns. I know that currently this is not working as all data end up in column A of the Excel sheet - so I would need to convert the number of the outer counter to A, B,... or find a different solution.
    Moreover on the snippet I placed an ActiveX Worksheet Property with the Chart Object - as I can see the difference to the Chart Object in the example code from the last link above is the color. However I'm not sure what that means and how to change/ solve this.
    And just to make sure - I know this way the VI does not run as the Chart Object is placed completely wrong - I just did it, so it is included in the snippet.
    I'd be thankful for any suggestions,
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    ExcelAreaScan.png ‏60 KB

    Hello everyone and thanks for the answers.
    I only have the LabView Student Edition available here - is the toolkit included in it too. How can I check if it is installed/ available and in case it is installed - where can I find it?
    Today I had time to take a look at the example
    Create via ActiveX Labview a XY Scatter plot graph on an excel sheet
    It almost does what I want in terms of creating a graph. The only problem I could not fix, is that in this example a sheet is created where only the graph is present. i'd like to add the graph to a previously created worksheet. Today I tried get this working but it seems I stilll don't really understand what I'm doing, I'll post a snippet of my code as soon as I can access the PC with LabView on it again.
    I also took a look at the other example for inserting 2D attays - it seems to be what I need, I just had no time so far to test it, I'll post an update when I could test it.
    Thanks for the help so far!

  • Calling graph from Reports created in graphics builder?

    Can you call a graph from Reports 6.0 that was created in Graphics Builder. I know you can call a graph from Forms. I tried creating my graph right in Reports with the wizard but for some reason it does not give me the fields I want to use in the available fields column, so I created the graph in Graphics Builder. Do you use a trigger of some sort. Any examples would be appreciated if this is possible. Thanks

    Justin Beno:
    Yes, you can call a graph from inside a report. All you need to do is select the button with the graph on it (not the icon with the wand, which indicates chart wizard). Then draw graph in the area of the report where you want the graph to display. After completing this, right click on graph, select Property Palette, Chart - Chart Filename (this is where you will type in the directory and filename of your graph that you created in Oracle Graphics).
    ~Vannette

  • Creating stacked graph from multiple rows

    Hi!
    I am trying to create a stacked bar graph from multiple rows. My data looks like this:
    Date_Time Error_Code Count
    16-01-2011 12:00 100 10
    16-01-2011 12:00 200 15
    16-01-2011 12:10 100 5
    16-01-2011 12:10 200 7
    16-01-2011 12:20 300 20
    16-01-2011 12:20 400 6
    I want to stack the count of each error_code on top of each other for every time group.
    Is this possible?
    Br
    Casper

    Hi,
    can you try
    - select the graph in the Structure Window or the visual editor
    - open Property Inspector
    - Press Pencil Icon
    - Click "Swap Bars with x-Axis"
    Frank

  • Write n then read xml from database to create graph in an applet

    Hi mates
    I have one problem I want show a trend(graph) from sql database which is having the records of about 8600 in a day. And i want to show a graph for a day
    but sometimes it gives a problem like out-of-memory, so can anyone tell me how i can get read of it.
    and other this can i use xml for this means first write a data in xml format from database then read it at sametime and show graph in applet
    can anytell me how to do it
    any suggesion is appreciable
    thanx

    Here's are two example for what you are looking for
    Re: Load xml data in Oracle table
    Re: insert .xml file into xmltype table?
    First you need to create a DIRECTORY object.  That is how Oracle works and it expects a DIRECTORY object instead of a physical path when performing operations that read/write from disk.  The directory path provided to the CREATE DIRECTORY command must be a directory that the machine Oracle DB resides on can see.
    Then you can go either of two routes.  You can INSERT that XML directly into a table, as shown in the second link I provided or you can read it into PL/SQL as the first link shows.  Then in either case, you can use SQL to parse the XML for you.
    Depending upon your needs, you may get better performance if you insert the XML into a table as the second link shows, assuming the XMLType column is stored as SECUREFILE BINARY XML.

  • Creating graphs in illustrator - from Excel

    Currently we're having issues with building graphs in Illustrator CS4. We drag the Excel graph from Excel to illustrator then recreate the graph ie click on the lines - make black, or another colour - fill bar graphs with other colours etc - Apple Mac 10.6.4  the programme keep crashing

    Try printing to a PDF and openeing that in Illustrator. You’ll still need to clean up the blacks, but the transfer should be less crash-prone.

  • Migrating Graphs from Reports 6i to Reports 10g

    While migrating Graphs from Reports 6i to Reports 10g is there a possibility of maintaining the same graphs rather than recompiling them using the Graph Wizard of Reports 10g. I have hundreds of reports with graphs and will be an uphill task to re-draft all the graphs. Kindly suggest alternatives to overcome this dead-lock.
    Thanx in advance
    Sridhar

    Hello Sridhar,
    10g is not supporting Graphics builder. So you got to create/insert all these 6i graphs in 10g. Open the 6i report and compile in 10g. It will give you file not found error. Delete the graph area in the layout editor.
    Then drag the chart icon and drop in layout. Redesign again. Offcourse it is not fun. But there is no way.
    Also there are tons of bugs in 10g report Graphs. You won't find some cool features like Others % option in the pie slice provided by Graphics bulider. You got to change graph.xml file for some of the features. Even the graphs looks ugly in 10g. Migrating graph reports is really frustrating in 10g. But we have no choice. Recently we migrated to 10g. Becareful with matrix reports. 10g keeps on getting crashed when ever we develop matrix report. GOD knows the reason.
    But 10g has some very very good features like Distribution
    Cheers.
    Ram.

  • How to create graphs on JSP page in JDeveloper 10.1.3

    Hi all,
    Is there an easy way to create graph objects with JDeveloper 10.1.3? I have taken a look to some tutorials, but it looks like they all use the "drag/drop graph from the data control palette" method.
    E.g. I got example 88 to work from http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html, but I have no idea how to get the BIGraphDef1.xml object and how to link it to a set of data.
    Are there some tutorials to show how graphs can be used in JDev 10.1.3?

    Frank,
    This is what I did to implement the graphic manual, but I think, I forgot something...
    1. create a new application with projects DataModel and UserInterface
    2. in the DataModel I created a similar master/detail view as the one of Steve, this is named:
    TestModuleDataControl
    \--DepView
    __\--Deptno
    __\--Dname
    __\--Loc
    __\--EmpView1
    ____\--Sal
    3. I created a new jspx page and added a graph tag:
    <f:verbatim>
    <graph:Graph data="${bindings.DepartmentsEmployeesInDepartmentGraph}"
    imageHeight="200" imageWidth="400"/>
    </f:verbatim>
    4. in the page definitions I added
    <graph id="DepartmentsEmployeesInDepartmentGraph"
    IterBinding="EmployeesInDepartmentIterator"
    ControlClass="oracle.dss.graph.Graph"
    SeriesLabel="Ename"
    GraphPropertiesFileName="userinterface.BIGrap1hDef1"
    SeriesType="SINGLE_SERIES">
    <AttrNames>
    <Item Value="Sal"/>
    </AttrNames>
    </graph>
    5. I added also the iterator:
    <iterator id="EmployeesInDepartmentIterator" Binds="EmpView1" RangeSize="10"
    DataControl="TestModuleDataControl"/>
    6. I copy/pasted the BIGraphDef1.xml from Steve's project into 'Application Sources'\userinterface.
    7. in the web.xml file in WEB-INF I added:
    <servlet>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <servlet-class>oracle.jbo.html.jsp.graph.GraphGeneratorServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>GraphGeneratorServlet</servlet-name>
    <url-pattern>/GraphGeneratorServlet</url-pattern>
    </servlet-mapping>
    8. when I run the page, I can't see the graph and there are also no errors. I think I mis a global setting somewhere...
    Is there anything I forgot to do?
    note: if I add a new jsp page into steve's application, I do can see the graph if I perform the steps mentioned above...
    I just found out that, If I create the graph on a page which is in the root directory, then it works. If I put it in a subdirectory, it doesn't:
    - create graph as mentioned above on a page: web content/myGraph.jspx --> works
    - create graph as mentioned above on a page: web content/app/myGraph.jspx --> doesn't work...
    Does somebody know where to put a setting/parameter to get the Graph visible in the subdirectory app?

  • 1 Graph from two queries

    Hi Guys,
    I have the following requirement :
    Query1 : Incidents open this  month
    Query 2:Incidents close this  month
    For the above queries i need to create a Webtemplate :  2 tables from 2 queries  + 1 Graph from two queries.
    Is it possible to get a single graph from two queries?If so can you enlighten me with the process please?
    Cheers,
    Stalin

    Hi ,
    As mentioned by alex please follow the steps below.
    1. Create a separate a query (Query3) based on your bothe queryies(Query1 &query2).
    2. In the webtemplate  Insert table1,table2 and Graph and assign Query1 to Table1 , query2  to table2 and query3 to graph.
    if u folow the above steps u will get the require otput

  • Create graph based on dynamic table data

    Hi experts ;
    i have JDeve Version 11.1.2.2.0 , i'm create dynamic table based on dynamic SQL query this query return by function in database by based on passing parameter .
    My question :-
    1- How create graph based on dynamic table and contral it at run time ?
    Thanks & Best Regards

    Hi Mostafa,
    You can retrieve the data from your sql query in a backing bean and pass it on to Graph using the setTabularData method.
    Here is the javadoc for the setTabulardata method:
    http://docs.oracle.com/cd/E16162_01/apirefs.1112/e17492/oracle/dss/dataView/CommonDataview.html#setTabularData%28java.util.List%29
    Hope this helps
    Katia

  • "How to create graphs in Reports"

    Hi All,
    Please anybody help me how to create graphs in the BEx Analyzer and whenever the reports will be refreshed the graphs should also be refreshed with the updated data.
    Help much appreciated.
    I will assign points.
    Thanks and Regards,
    Sunil Morwal.

    Hi Sunil,
    You can get charts in Bex Analyzer. After you execute the report, from the Tools menu > Insert Chart. You can position and edit the chart as desired and save this as a workbook.
    Hope this helps...
    Regards.

  • Export graphs from Web report

    Hi.
    I need to copy graphs from web reports in 3.5.To do this, i have followed a roundabout:
    1. Save the page as mht (web archive file)
    2.Copy the image from there and paste into Powerpoint or wherever required.
    Is there any better way to do it? Or can I bring the save as mht option in the context menu?
    Is SAP addressing it any soon?
    Also is there any way to send graphs in addition to the tables via the 'distribute as email option"?
    Cheers
    Anand

    When you broadcast using the standard template the template '0QUERY_TEMPLATE_BROADCASTING' is used for broadcasting. This template only has a navigation block and table item, this is the reason why the chart is not displayed in this template. If you create a custom template for broadcasting which has chart item in it you will be able to get the chart displayed (it will be always displayed.) See the attached link for custmoizing.
    http://help.sap.com/saphelp_nw04/helpdata/en/3a/0e044017355c0ce10000000a1550b0/content.htm
    You can also override this behaviour if you attach the query to a custom web template, in this case when you broadcast you will get exactly what you see in the current report.

  • How to create graph through form9i

    dear,
    I mant to know how to create graph in form 9i.Right now i have no idea about graphs use in form9i.
    please reply me as soon as possible.
    my mail id is [email protected]
    If you have any answer related to this problem please mail me in my mail id that i have given .
    with regards
    monika gupta

    Hi Monika,
    http://www.oracle.com/technology/products/reports/htdocs/faq/faq_migration.htm
    http://www.oracle.com/technology/products/reports/10gr2/Reports_guide_to_changed_functionality.pdf
    http://download.oracle.com/docs/html/A90900_01/rwtutorial_graph.htm#1005697
    How do I migrate my charts from Oracle Graphics to the new graph format in Oracle Reports 10g?
    Since release 9i, Oracle Reports uses Business Intelligence Beans (BI Beans) to create and display graphs in reports. There is no direct migration path from Oracle Graphics to the BI Beans graphing functionality. As such, the user will need to rewrite all of their graphs using the new Graph Wizard within the Oracle Reports Builder 10g. Oracle Reports 10g supports over 50 graph types, including 3D graphs. However, keep in mind that it does not support some special types, such as Gantt charts.
    It seems direct graph 6i migration is not possible from reports10g.
    It is asking to use the chart wizard again with your query.
    Please follow the above two link it may helps u a lot.

  • Trouble updating a JtextArea from a JTable ListSelectionListener..

    Hi, I'm having trouble updating a JtextArea from a JTable ListSelectionListener, it is working for another JTextArea but I have created JNMTextArea which extends JTextArea and I am getting no data passed to it.
    Any help is really greatly appreciated. Im a relative newbie to Java.
    Here is the class declaration for JNMTextArea
    public class JNMTextArea extends JTextArea
         //Constructor
         public JNMTextArea(String text){
              super(text);
              setLineWrap(true);
              setEditable(false);
         //Constructor
         public JNMTextArea()
              this(new String());
         //This sets the data in setText, works ok.
         void displayPacket(Packet p){
              //Function works fine
              //Need to pass this data to the JNMTextArea!!!
              setText(buffer.toString());
              setCaretPosition(0);
    Here is where I use JNMTextArea, Im
    class JNMGui extends JFrame implements ActionListener, WindowListener{
         public static JNMTextArea txtPktContent;
         //Constructor
              JNMGui(){
                   buildGUI();
         private void buildGUI(){
         mainWindow = new JFrame("Monitor");
         tblPacket = new JTable(tblPacketM);
         tblPacket.setToolTipText("Packet Panel");
         tblPacket.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         if (ALLOW_ROW_SELECTION) {
              ListSelectionModel rowSM = tblPacket.getSelectionModel();
              rowSM.addListSelectionListener(new ListSelectionListener() {                     public void valueChanged(ListSelectionEvent e) {
                        if (e.getValueIsAdjusting())
                             return;
                        ListSelectionModel lsm =      (ListSelectionModel)e.getSource();
                        if (lsm.isSelectionEmpty()) {
                             System.out.println("No rows are selected.");
                        else {
                             int selectedRow = lsm.getMinSelectionIndex();
                             selectedRow++;
                             String str;// = "";
                             //Unsure if I need to create this here!
                             txtPktContent = new JNMTextArea();
                             //This works perfectly
                             txtPktType.append ( "Packet No: " + Integer.toString(selectedRow) + "\n\n");
                             Packet pkt = new Packet();
                             pkt = (Packet) CaptureEngine.packets.elementAt(selectedRow);
                             if(pkt.datalink!=null && pkt.datalink instanceof EthernetPacket){
                                  str = "Ethernet ";
                                  //THis works txtPktType is another JTextArea!!          
                                  txtPktType.append ( s );
                                  //This is not working
                                  //I realise displayPacket return type is void but how do get
                                  //the setText it created to append to the JNMTextArea??               
                                  txtPktContent.displayPacket(pkt);
              //Adding to ScrollPane
              tblPane = new JScrollPane(tblPacket);
              txtPktTypePane = new JScrollPane ( txtPktType );
              txtPktTypePane.setToolTipText("Packet Type");
              txtPktContentPane = new JScrollPane ( txtPktContent );
              txtPktContentPane.setToolTipText("Packet Payload");
              panel.add( tblPane, BorderLayout.CENTER );
    //End Class JNMGui

    void displayPacket(Packet p){
              //Function works fine
              //Need to pass this data to the JNMTextArea!!!
              setText(buffer.toString());
              setCaretPosition(0);
    This seems really odd. Notice that you pass in "p" but use "buffer". Where is "buffer" defined?

Maybe you are looking for

  • When trying to update apps it keeps telling me my account cannot be verified. How do I fix this?

    When trying to update my apps it keeps telling me it cannot verify my address! How do I fix this?

  • ATP check based on production finish date

    Hi all, customer order goods for the 02.06.09. Transportation take 10 days so,  by itinerary , I'll have the material avaiability date for the 15.05.2009. All' it's OK. Mrp planner , based on customer calendar, insert demand for customer date 02.06.0

  • Read Multi Line from External File

    Greetings all, I am building a page that has random Bible scripture on the bottom and I have the scriptures saved in a text file and flash pulls it from there. I am trying to get the Chapter and verse portion of the text to be on a new line when brou

  • Activation and upgrade system for java application

    Hi guys, i've a question for you. I need to develop a professional application in java (+java fx) and I want to distribuite it on the net. I've to manage these situations: 1) I need to have a "trial" version, with an endline after x days 2) I need to

  • Can I delete message in SE91 ?

    Hello, I want to delete two messages in SE91 because some warning appear in the reporting. The class message is RSUOM. Can i do it in the SE91 transaction? I know I can do it in each Bex Query in the RSRT transaction, but we can change this option in