How create a XYChart.Series from and ObservableList

I have a simple ObservableList made up of ChartPoints - a class that contains a String and a Double with all the setters and getters.
its named chart1Data. I am trying to create a BarChart to use the chart1Data.
How do I get the XYChart.Series to load the list?.
I get a no suitable method found error.
Here is my code
The ChartPoint class
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleStringProperty;
public class ChartPoint {
    public final SimpleStringProperty description;
    public final SimpleDoubleProperty amount;
    public ChartPoint(String desc, Double amt) {
    this.description = new SimpleStringProperty(desc);
    this.amount = new SimpleDoubleProperty(amt);
    public String getDescription() {
        return description.get();
    public void setDescription(String desc) {
        description.set(desc);
    public SimpleStringProperty descriptionProperty() {
        return description;
    public Double getAmount() {
        return amount.get();
    public void setAmount(Double amt) {
        amount.set(amt);
    public SimpleDoubleProperty amountProperty() {
        return amount;
The Class to draw the Chart
public class FinX2ChartClass {
       private Stage chart1Stage = null;
        @FXML private static BarChart<String, Number> bc1;
        XYChart.Series<String, Number> series1 = new XYChart.Series<>();
private static final ObservableList<ChartPoint> chart1Data = FXCollections.observableArrayList(
     new ChartPoint ("April",10.00),
     new ChartPoint ("May", 20.00),
     new ChartPoint ("June", 30.00));
    public void makeStage() throws IOException {
        chart1Stage = new Stage();
        Parent root = FXMLLoader.load(getClass().getResource("FinX2Chart1.fxml"));
// This approach does not work error no suitable method found
       series1.getData().add(chart1Data );
        bc1.getData().addAll(series1);
        chart1Stage.setScene(new Scene(root));
        root.getStylesheets().add("supportfiles/chartstylesheet.css");
        chart1Stage.show();
public ObservableList<ChartPoint> getPoints() {
        return chart1Data;
public void closeStage(){
         chart1Stage.close();
The complier error message
\ error: no suitable method found for add(ObservableList<ChartPoint>)
series1.getData().add(chart1Data );
method List.add(int,Data<String,Number>) is not applicable
(actual and formal argument lists differ in length)
method List.add(Data<String,Number>) is not applicable
(actual argument ObservableList<ChartPoint> cannot be converted to Data<String,Number> by method invocation conversion)
Note: /Users/David/NetBeansProjects/FinX2/src/finx2/FinX2ChartClass.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Can anyone point me in the right direction

Thanks for your suggestion but with your proposed change I now get another error. I have shown where in the code the errors are
See bottom of post for error detail
Any thoughts ?
the revised chart class
public class FinX2ChartClass {
       private Stage chart1Stage = null;
        @FXML private static BarChart<String, Number> bc1;
        XYChart.Series<String, Number> series1 = new XYChart.Series();
//*** The next line gives an incompatible types error
private static final ObservableList<XYChart<String,Number>> chart1Data = FXCollections.observableArrayList(
     new XYChart.Data("April", 10.00),
     new XYChart.Data("May", 20.00),
     new XYChart.Data("June", 30.00));
    public void makeStage() throws IOException {
        chart1Stage = new Stage();
        Parent root = FXMLLoader.load(getClass().getResource("FinX2Chart1.fxml"));
//*** The next line gives a no suitable method found error
       series1.getData().add(chart1Data );
        bc1.getData().addAll(series1);
        chart1Stage.setScene(new Scene(root));
        root.getStylesheets().add("supportfiles/chartstylesheet.css");
        chart1Stage.show();
public void closeStage(){
         chart1Stage.close();
}The error message
/Users/David/NetBeansProjects/FinX2/src/finx2/FinX2ChartClass.java:25: error: incompatible types
private static final ObservableList<XYChart<String,Number>> chart1Data = FXCollections.observableArrayList(
required: ObservableList<XYChart<String,Number>>
found: ObservableList<Data>
/Users/David/NetBeansProjects/FinX2/src/finx2/FinX2ChartClass.java:38: error: no suitable method found for add(ObservableList<XYChart<String,Number>>)
series1.getData().add(chart1Data );
method List.add(int,Data<String,Number>) is not applicable
(actual and formal argument lists differ in length)
method List.add(Data<String,Number>) is not applicable
(actual argument ObservableList<XYChart<String,Number>> cannot be converted to Data<String,Number> by method invocation conversion)
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

Similar Messages

  • I found how to delete a series from my ipad, but it still won't download the last episode of the new series I am trying to have.  What have I done wrong?

    I found how to delete a series from my ipad, but it still won't download the last episode of the new series I am trying to have.  What have I done wrong?

    What is the GarageBand version that your friend is using?
    If it is GarageBand '11, version 6.0.5, you can buy GarageBand '11 as a boxed retail version with the iLIfe '11 bundle, e.g. from Amazon.
    Then you can upgrade GarageBand '11 to 6.0.5, using this upgrader from the Support page:
                     GarageBand 6.0.5
    GarageBand 6.0.5 will work well with your system.  But if your friend is using the newest GarageBand 10, this will not help. Then ask your friend to send you audio files for each track, so you can recreate the project from the audio.  Or your friend could also use GarageBand '11 for the projects you want to share, that will run well in all newer MacOS X versions, even with GarageBand 10.0 installed on the same system.
    -- Leonie

  • Query to get number of invoice created by user between from and to date

    Dear All
    I need Query to get number of invoice created by user on day and his orgainization between from and to date.
    thanks

    select count(*) from ap_invoices_all where created_by = :p_User_id
    and trunc(creation_date) between :p_from_date and :P_to_date;
    Thanks/SRK

  • How add to Bin location From and to fields in PLD

    Hi Guys,
    I have been trying to add bin locations fields "from" and "to" represented in the inventory transfer in order to see from which bin its being transferred as well as to. I cant seem to find the data of the bin location
    in any of the bin location tables. Please can you assist.
    Kind Regards,
    Kennedy Tsamba

    Hmm, I'm not sure what I'm doing wrong.  The field name is SPART in table MARA.  It has a "to" "from" selection option.
    I've tried:
    CLEAR <SPART>[].
    but I get the message that field "<SPART.[]" is unknown and that it's not in one of the tables (it is).
    So then I tried:
    CLEAR <MARA-SPART>[].
    but I get the message that the field "<MARA" is uknown, but there is a field with the similar name "MARA".
    I've tried various combinations since then, but each one produces an error message.  The only way I can avoid a syntax error is to type:
    CLEAR MARA-SPART.
    but then it doesn't work anyway.
    I'm sure it's very simple, but I'm really stumped.
    Lynn

  • How create report with data from table and some columns results function ?

    Hi,
    How can i create on apex report region with some columns (of the report) as returned from a table and the other columns as results of plsql functions ?
    for example , I want to create a report like that:
    device last_date error_msg stop/start
    kodak1 06/04/08 null >>
    kodak2 08/03/08 good msg --^--
    kodak3 08/04/08 err msg >>
    3 rows returned
    where the 3 first columns are data returned from the table and the forth column is the result of plsql function (returned for example false) and on that i want to display a button of start ( >> in this example ) or stop ( --^-- in this example)

    Thomas,
    There is no problem here -- this is fully suported scenario.
    1. Bind Table dataSource to Customers node.
    2. Bind individual cell editors to any attribute of customer or any nested node like Address, say create column with InputField as editor, then for "value" property select Customer.Address.Street.
    Your nested nodes (like Address) must be non-singleton, set singleton=false on context designer tab.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Creating a new window from and action event

    Hey I have a problem i would like most of my menu items to create a new window containing a set text and i was thinking of creating a new container with a JTextArea but for some reason its not working. if someone could help me that be great... so my question is how do create another window (TextArea) with my tokenized array info in it open up when Print File or Print Total is the event??
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.util.StringTokenizer;
    import javax.swing.plaf.*;
    class PhoneProject extends JFrame implements ActionListener
         private static final int WIDTH = 260;
         private static final int HEIGHT = 160;
         private static final int X_ORIGIN = 402;
         private static final int Y_ORIGIN = 299;
         ArrayList internalCalls = new ArrayList();
         ArrayList externalCalls = new ArrayList();
         PhoneCall internal;
         PhoneCall external;
         JMenu query = new JMenu("Query");
         JMenu proccess = new JMenu("Proccess");
         String inRecord;
         int numExtension;
         int numCallType;
         int numSeconds;
         int totalIntTime;
         int totalExtTime;
    public static void main(String args[])
              PhoneProject frame = new PhoneProject();
              frame.setVisible(true);
    public  void LoadArray(File myFile) throws IOException
              FileReader fr = new FileReader(myFile);
              BufferedReader br = new BufferedReader(fr);
              while ((inRecord = br.readLine()) != null)
                   StringTokenizer tokenizer = new StringTokenizer(inRecord);
                   String extension = tokenizer.nextToken();
                   String callType = tokenizer.nextToken();
                   String seconds = tokenizer.nextToken();
                   numExtension = Integer.parseInt(extension);
                   numCallType = Integer.parseInt(callType);
                   numSeconds = Integer.parseInt(seconds);
                   if (numCallType == 0)
                        internal= new PhoneCall(numExtension, numCallType, numSeconds);
                        totalIntTime = (totalIntTime + numSeconds);
                        //System.out.println(totalIntTime + "int");
                        internalCalls.add(internal);
                   if (numCallType == 1)
                        external = new PhoneCall(numExtension, numCallType, numSeconds);
                        totalExtTime = (totalExtTime + numSeconds);
                        //System.out.println(totalExtTime + "EXT");
                        externalCalls.add(external);
                   System.out.println(internal.getSeconds());     
         public PhoneProject()
              Container contentPane;
              setBounds(X_ORIGIN, Y_ORIGIN, WIDTH, HEIGHT);
              setTitle("Phone Analyzer");
              setResizable(true);
              contentPane = getContentPane();
            contentPane.setLayout(new BorderLayout());
              JMenu file = new JMenu("File");
              JMenuItem  item;
              item = new JMenuItem("Open");
              item.addActionListener(this);
              file.add(item);
              item = new JMenuItem("Exit");
              item.addActionListener(this);
              file.add(item);
              proccess.setEnabled(false);
              item = new JMenuItem("Print File");
              item.addActionListener(this);
              proccess.add(item);
              item = new JMenuItem("Print Totals");
              item.addActionListener(this);
              proccess.add(item);
              item = new JMenu("Low and High");
              item.addActionListener(this);
              proccess.add(item);
              JMenuItem subItem = new JMenuItem("Compare");
              subItem.addActionListener(this);
              item.add(subItem);
              query.setEnabled(false);
              item = new JMenu("Average Total Utilization");
              item.addActionListener(this);
              query.add(item);
              JMenuItem itemInt = new JMenuItem("Internal");
              itemInt.addActionListener(this);
              item.add(itemInt);
              JMenuItem itemExt = new JMenuItem("External");
              itemExt.addActionListener(this);
              item.add(itemExt);
              item = new JMenuItem("Highest Internal Utilization");
              item.addActionListener(this);
              query.add(item);
              item = new JMenuItem("Highest Total Utilization");
              item.addActionListener(this);
              query.add(item);
              JMenuBar menuBar = new JMenuBar();
            setJMenuBar(menuBar);
            menuBar.add(file);
            menuBar.add(proccess);
            menuBar.add(query);
              contentPane.add(new JTextArea("Phone Report"));
      public void actionPerformed(ActionEvent event)
           String menuName;
           menuName = event.getActionCommand();
           if (menuName == "Open")
                JFileChooser chooser = new JFileChooser();
                int returnVal = chooser.showOpenDialog(this);
                if (returnVal == JFileChooser.APPROVE_OPTION)
                     try
                        File myFile = chooser.getSelectedFile();
                        this.LoadArray(myFile);
                        proccess.setEnabled(true);
                        query.setEnabled(true);
                     catch (Exception e)
         if (menuName == "Print File")
    JTextArea display = new JTextArea();
              display.setText("Hello");testing to see if it works
              display.setVisible(true);
         if (menuName == "Print Total")
                                               JTextArea display = new JTextArea();
              display.setText("Hello");//testing
              display.setVisible(true);
           if (menuName == "Exit")
                System.exit(0);
    }Phone.txt
    2000 0 300
    2000 0 538
    2000 1 305
    2000 1 729
    2005 0 205
    2005 0 305
    2005 1 592
    2005 1 594
    2010 0 364
    2010 0 464
    2010 1 904
    2010 1 100
    2020 0 234
    2020 0 839
    2020 1 999
    2020 1 210
    Assignment: Array Based GUI Assignment
    Telephone call data has been collected from a company's telephone switch. You have been asked to analyze it and produce various statistics.
    Input File
    The input file is a sequential file. It is in no specific order. The file contains an extension number, type of call, and the length of call in seconds. A record is produced each time a call is made from that extension. You should create your own test file.
    Field     Type     Description
    Extension     Integer     Extension number. This is a 4 digit number. Valid Extensions are 2000 to 2020.
    Type     Integer     Value of 1 means internal, any other value is an external call.
    Time     Long     Length of call in seconds
    Example:
    �     2000,1,60 : ----->>>> Extension 2000 had an internal call that lasted 60 seconds
    �     2000,1,356: ----->>>> Extension 2000 had an internal call that lasted 356 seconds
    �     2019,2,65: ------>>>> Extension 2019 had an external call that lasted 65 seconds
    �     2001,1,355: ----->>>> Extension 2001 had an internal call that lasted 355 seconds
    Process
    1.     Use 2 arrays to accumulate the time of calls for each extension, both internal and external.
    2.     The reports and queries are to be produced from the arrays.
    Hints:
    �     Create 2 arrays: one for internal calls and one for external calls.
    �     Load the arrays in Form Load: do not do any calculations here.
    �     The report and queries can totally be produced from the arrays.
    Output: Report
    Telephone Useage Report
    Extension Internal External
    2000 4500 3500
    2001 19350 22981
    2002 2333 900
    2003 3144 122
    Totals 99999 99999
    Output: Queries
    On the form add add query capability.
    1.     Average Total Utilization: Internal Calls: 9999 (total length of all internal calls / number extensions)
    2.     Average Total Utilization: External Calls: 9999
    3.     Extension with the highest internal call utilization: Ext xxxx; 9999 seconds.
    4.     Extension with the highest total utilization.
    Form Design
    The design of the form is up to you. However, use the following guidelines:
    �     use menus (preferred) or command buttons
    �     use a common dialog box to ask for the file name
    �     use a list box or text box to display the output
    the caption on the form should include your name

    hi
    u can try like following code
    if (menuName == "Print File")
              new mytextframe();
    class mytextframe extends JFrame{
         JTextArea display = new JTextArea();
         public mytextframe()
              setSize(300,300);
              setVisible(true);
              add(display);
              display.setText( "ello");
    }

  • How create XML example file from DTD

    Hi,
    I'm using for good tips/solution (I didn't find anyone) how to create example xml from existing DTD?
    Best Regards,
    Rafal

    Various tools are available generate an XML document from a DTD.
    http://www.eclipse.org/webtools/community/tutorials/XMLWizards/XMLWizards.html
    http://www.altova.com/products/xmlspy/dtd_editor.html
    http://www.stylusstudio.com/xml_generator.html

  • HT4527 How do I transfer music from and Ipod to a new PC if it is already synced with another unit that is damaged?

    My Mac crashed and I cannot recover old Itunes folder. I have a Ipod that is synced with the Mac, and I want to transfer all the music on this Ipod to my new PC.
    Yes, I also have a 2nd Ipod that is already synced with the new PC. HELP!

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do i move contacts from and external back up drive to a macbook pro?

    I was able to successfully move a few other files. Garageband, text edit and itunes were a breeze. Contacts are giving me a hard time!

    Does she have any photos in the iPhoto library on her new machine?
    What version of iPhoto does she have?
    The general answer is to trash the iPhoto library on the new computer (assuming it is empty) and drag the old iPhoto library to the pictures folder of the new machine and launch iPhoto letting it convert the library
    LN

  • How to pass Valid from and Valid to Dates in CS_BOM_EXPLOSION

    Hii Experts,
    My requirement is to explode BOM using CMC LDB and generating files for all the remaining months by varying Valid from and Valid to dates. For this I am using CS_BOM_EXPLOSION but it has provision for a single date field.
    Can you please guide me how to pass both Valid from and Valid to dates in CS_BOM_EXPLOSION ? And if you can suggest any other alternative, its most welcome...
    Regards,
    Vikas

    Hi Vikas,
    There is a tables parameter STBP which is of type CSXGEN.
    This structure CSXGEN contains two fields valid from date(DATUV) and valid to date(DATUB).
    Is this what something you are looking for?
    Regards,
    Swarna Munukoti

  • Printing From and To Date on an XML Report

    I have several reports in xmlp that are generated with a select statement of date ranges. How can I put the from and to dates on the header of the reports?

    <?start:body?>
    <?end body?>
    You can find more in UserGuide5.6.2

  • How do you transfer data from an older desktop to a new one?

    How do you transfer data from and older desktop to a new one?  Appreciate any guidance you can provide.

    How to use Migration Assistant:
    http://support.apple.com/kb/HT4413?viewlocale=en_US
    http://support.apple.com/kb/TS1963
    Troubleshooting Firewire target disk mode:
    http://support.apple.com/kb/HT1661
    Migrating from PPC Macs to Intel Macs:
    https://discussions.apple.com/docs/DOC-2295
    http://support.apple.com/kb/HT4796

  • How to stop Windows iTunes from spontaneously creating new folders with duplicate copies of songs, and renaming existing folders?

    I've recently started using iTunes regularly to import CDs. Since then, I've found my Windows 'My Music' folder is behaving in bizarre ways.
    I like to organise most of my music in folders by Genre --> Album title, without paying attention to Artist. I also like to rename certain album folders (and the Album name in each track's metadata as well, so that each album/folder remains consistent), and also to create customised 'mix tape' album folders. I just want to use Windows Explorer / My Computer to manage this; I don't want to do it via iTunes. I just want to use iTunes for initially getting the music from CD to computer.
    Previously, when I was using Windows Media Player to import CDs, if Windows Media Player placed an imported CD under a folder category I don't use, such as Artist, I would just manually move the Album folder and delete the empty parent Artist folder. However these days iTunes is spontaneously creating an entire series of Artist folders, even for tracks and albums that were already on my computer, and is placing duplicate track files into them. Additionally, it's renaming albums for folders and tracks I've customised, turning album titles back into their original values. This is happening even though the destination for newly imported/downloaded iTunes tracks is not the My Music folder itself, but rather another folder within that one. I've had a look at Preferences --> Advanced and the 'Keep iTunes media folder organised' and 'Copy files to iTunes Media folder when adding to library' boxes are already unchecked, so it's not related to that anyway. How do I get iTunes to leave my folders alone?

    First off see this user tip so should any further unwanted changes happen you have a chance to revert to your original layout.
    It is not unknown for AV software to interfere with iTunes and corrupt its configuration files. If this happens iTunes can revert to the default settings to "Keep..." & "Copy...". Deselecting those options won't return any files to their original paths.
    If you have "Show iTunes in the Cloud Purchases" enabled under Edit > Preferences > Store that can lead iTunes to download the original metadata for any of your purchases and show that instead of any edits you may have made to it. Turing that option off and restarting iTunes may reveal your version of the metadata.
    There is another option under Edit > Preferences > Store that reads "Share details about your library with Apple" although I don't think that changes metadata in the way that the similar option in Windows Media Player does. Double-check your settings in Windows Media Player (Options > Library) to make sure it isn't set to "Retrieve additional information from the Internet". This is usually the cause of spontaneous tag resetting. WMP can be called into life in the background when visiting certain websites and it has a lazy cache, meaning it can sometimes write out metadata to your media files long after the data was originally acquired.
    It is also work noting that mp3 files may contain multiple tags and iTunes, for one, treats these unpredictably. In some cases it may appear to accept and write out a tag change only to later read back the original unchanged data from another copy of the tag.
    tt2

  • How to create a VI that detects and records responses from user

    Does anyone has experience in creating a VI that allows the user to e.g., watch a video or series of images, pause or rewind video etc. and the VI records the duration of all pauses or user responses.

    avenue wrote:
    How to create a VI that detects and records responses from user
    You definitely need to check what 'EVENT STRUCTURE' is and how to use it... because thats needed to write such code.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

Maybe you are looking for

  • Problem with N79

    Hello ! First, sorry for my poor english. I have a problem with my N79 phone, i have reinstalled the software with Nokia Software Updater and after restarting the phone and message "Reinstalling done" or something like this I saw that font was not th

  • Skipped seconds in time stamp loop

    Hi all, I have a two 6024E cards which I am synchronizing via a RTSI cable. I have an 860mHz Dell dimension with 512 MB of RAM. I am simply logging analog signals from the cards to a text file on a 1s timebases. The problem is that the output data fi

  • Stand-alone executable will not call dll

    Hi I am building a datalogger application which uses a dll library from ADAM 5000. I've made the application and it works fine when used in labview but when I make it an executable file it does not communicate with the external device. I cannot conne

  • Which Operating system most company use to run oracle?

    Which Operating system most company use to run oracle? thanks

  • Packages to install over the base packages

    I have a KDE MOD arch installation and I have installed lots of packages, my question is how can I find a list of packages which I can install over the base install so that I can get all the programs installed which I have now.... for example i want