How to add Line Chart in javafx 2.2 FXML?

I'm using javaFX scene builder 1.0. The LineChart component is not working for FXML ,I'm added a linechart component in FXML and initialized it in corresponding controller class. it displays the gui as default linechart ,when i'm adding some values of x and y using obsevablelist in the java controller class, it is not updating in the Linechart gui.

It's hard to say for sure without seeing the complete markup and controller code, but it looks like you are replacing the "graph" instance you declare in markup with a new one you create in code:
graph = new LineChart(xAxis, yAxis, lineChartData);Rather than creating a new chart, try declaring the chart with the axes you want in markup, and then call setData() on it instead of creating a new one:
<Scene fx:controller="test.LineChartTestController" xmlns:fx="http://javafx.com/fxml">
    <LineChart fx:id="graph">
        <xAxis><NumberAxis label="Values for X-Axis" lowerBound="0" upperBound="3" tickUnit="1"/></xAxis>
        <yAxis><NumberAxis label="Values for Y-Axis" lowerBound="0" upperBound="3" tickUnit="1"/></yAxis>
    </LineChart>
</Scene>
public class LineChartTestController {
    @FXML private LineChart<Double, Double> graph;
    @FXML
    protected void initialize() {
        ObservableList<XYChart.Series<Double, Double>> lineChartData = FXCollections.observableArrayList();
        LineChart.Series<Double, Double> series1 = new LineChart.Series<Double, Double>();
        series1.setName("Series 1");
        series1.getData().add(new XYChart.Data<Double, Double>(0.0, 1.0));
        series1.getData().add(new XYChart.Data<Double, Double>(1.2, 1.4));
        series1.getData().add(new XYChart.Data<Double, Double>(2.2, 1.9));
        series1.getData().add(new XYChart.Data<Double, Double>(2.7, 2.3));
        series1.getData().add(new XYChart.Data<Double, Double>(2.9, 0.5));
        lineChartData.add(series1);
        LineChart.Series<Double, Double> series2 = new LineChart.Series<Double, Double>();
        series2.setName("Series 2");
        series2.getData().add(new XYChart.Data<Double, Double>(0.0, 1.6));
        series2.getData().add(new XYChart.Data<Double, Double>(0.8, 0.4));
        series2.getData().add(new XYChart.Data<Double, Double>(1.4, 2.9));
        series2.getData().add(new XYChart.Data<Double, Double>(2.1, 1.3));
        series2.getData().add(new XYChart.Data<Double, Double>(2.6, 0.9));
        lineChartData.add(series2);
        graph.setData(lineChartData);
        graph.createSymbolsProperty();
}

Similar Messages

  • Urjent-how to add line items in tcode-FBL3N

    Hi Experts,
      How to add line items customer, customer name,  vendor and vendor name in FBL3N.
    Thanks in advance.
    mahe
    Moderator message - Please do not use words like "urjent". Please ask a specific question. Please search the forum. This question has been asked and answered before. Post locked
    Edited by: Rob Burbank on Apr 29, 2009 11:27 AM
    Edited by: Rob Burbank on Apr 29, 2009 11:28 AM

    Hi,
    Check the BTE's:
    00001020     POST DOCUMENT:       Prior to final checks             SAMPLE_INTERFACE_00001020
    00001025     POST DOCUMENT:       Final checks completed       SAMPLE_INTERFACE_00001025
    00001030     POST DOCUMENT:       Posting of standard data     SAMPLE_INTERFACE_00001030
    00001050     POST DOCUMENT:       Accounting interface           SAMPLE_INTERFACE_00001050
    Thanks & Regards,
    Harish

  • Line chart in javafx

    I have to animate line chart in javafx?
    Can anybody help?????????

    a_b_g wrote:
    If you are trying to create a moving chart, your trace is a series of lines with their values in a sequence. To make the chart move, delete the last value in the sequence then insert to new current value at the beginning of the sequence. This has the effect of moving the whole sequence up 1 position
    alexpackage areachart1;
    import javafx.animation.Timeline;
    import javafx.animation.Interpolator;
    import javafx.scene.Scene;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.part.NumberAxis;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    *@author Administrator*
    var x : Number = 0;
    var y : Number = 0;
    Timeline {
    repeatCount: 1
    keyFrames: [
    at (1s) {x => 0.0; y => 0.0;}
    at (2s) {x => 1.0; y => 1.0;}
    at (3s) {x => 2.0; y => 2.0;}
    at (4s) {x => 3.0; y => 1.0;}
    at (5s) {x => 4.0; y => 0.0;}
    }.play();
    Stage {
    title: "Application title"
    scene: Scene {
    width: 600
    height: 600
    content: [
    VBox {
    content: [
    LineChart {
    title: "Clarification Dynamics"
    dataEffect: null
    xAxis: NumberAxis {
    lowerBound: 0
    upperBound: 10
    label: "Suspended solids conc. (kg/m2)"
    yAxis: NumberAxis {
    lowerBound: 0
    upperBound: 10
    label: "Solid Flux"
    tickMarkVisible: false
    data: [
    LineChart.Series {
    data: [
    LineChart.Data {xValue:  bind x yValue: bind y }
    LineChart.Data {xValue: bind x+1 yValue: bind y+1 }
    *{color:#800080}*
    this is the code that i had written
    but in this a line is created and it moves along a curved path as specified...
    but i have to show a graph being plotted from origin to some x,y coordinates...
    *can anybody help...{color}*
    Edited by: sshruti_remo on Jun 1, 2010 2:43 AM

  • How to create line chart

    Hii Experts,
    How to create line chart?
    I want to  prepaire a line chart in a report. i have 1 table. In a table have 2 fields. chart is created in these 2 field refrence how It's possible?
    Thanx in Advance
    Regards
    Vshal

    I found it very easy to produce a line chart in a window container using FM GFW_PRES_SHOW.  In my case this produces a basic line graph with three lines across 15 time periods.
    See transaction GRAL for various chart types...they're relatively easy to produce...  I picked DEMO_GFW_PRES_SHOW report program from GRAL as my example for how to produce a simple line chart very quickly.

  • How to add line series dynamically to a line chart in flex?

    hi..i need to add line series dynamically to a line chart..depending on an array..the application is this..i have an array which stores the details of the users connected to an fmi server..the chart should display the bandwidth of each client..so the users should be added and removed from the chart dynamically...

    Hi
    1.I am giving you solution for dynamically adding values to the dropdown
    public void addValue( )  //Method Name in Component controller
        //@@begin addValue()
              IWDNodeInfo nodeinfo = wdContext.nodeNodeTestData().getNodeInfo();// Node should be map to the view's Node
              IWDAttributeInfo att = nodeinfo.getAttribute("VechileTypes");// Attribute by which dropdown in bound//
              IModifiableSimpleValueSet svSet = att.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
              svSet.put(wdContext.currentNodeTestDataElement().getInpAtt(),wdContext.currentNodeTestDataElement().getInpAtt());
        //@@end
    2.   wdThis.wdGetLangCompController().addValue(); // call this method in the point where u want to add values to the dropdown.

  • How to customize line chart series and symbols?

    Hello Forum,
    who can help me to customize line chart series and symbols color?
    I need to customize this in dynamic way.
    Thanks in advanced.

    See example 8-10 (Example 8-10 Changing Chart Symbol Color) from http://docs.oracle.com/javafx/2.0/charts/css-styles.htm#CIHGIAGE (reproduced here).
    The linked tutorial document contains a picture of how this example renders.
    .chart-series-line {   
        -fx-stroke-width: 2px;
        -fx-effect: null;
    .default-color0.chart-series-line { -fx-stroke: #e9967a; }
    .default-color1.chart-series-line { -fx-stroke: #f0e68c; }
    .default-color2.chart-series-line { -fx-stroke: #dda0dd; }
    .default-color0.chart-line-symbol { -fx-background-color: #e9967a, white; }
    .default-color1.chart-line-symbol { -fx-background-color: #f0e68c, white; }
    .default-color2.chart-line-symbol { -fx-background-color: #dda0dd, white; }Note the two comma separated colors listed for each -fx-background-color for the chart-line-symbol.
    The first color is the color or the outside of the symbol, the second is the inside of the symbol.
    In the sample css you provided you only supply a single background color for the chart-line-symbol, when two colors are required.

  • How to dispaly Line chart in output?

    Hi All,
    My requirement is that I want to display a line graph for 'year vs revenue' after calculation of revenue.
    I tried this with the FM GRAPH_2D . It displays only bar chart initially, for getting Line chart I have to choose it manually in options after displaying it, but I want to display the line graph directly without any manual operation.
    I've used the FM as below,
    CALL FUNCTION 'GRAPH_2D'
      EXPORTING
        inform             = 'X'
    *    display_type       = ''
        titl               = 'Year Vs Revenue'
      TABLES
        data               = it_summary
      EXCEPTIONS
        gui_refuse_graphic = 1
        OTHERS             = 2.
    Please let me know how to get the line chart directly using either FM GRAPH_2D or any other FM if you know that could do this.

    Hi,
    try this:
    DATA: BEGIN OF IGRAPH OCCURS 0,
            TXT   TYPE CHAR10,
            VALUE TYPE P,
          END   OF IGRAPH.
    DATA: TITLE(80) VALUE 'Header'.
    IGRAPH-TXT = '2000'. IGRAPH-VALUE = 10. APPEND IGRAPH.
    IGRAPH-TXT = '2001'. IGRAPH-VALUE = 23. APPEND IGRAPH.
    IGRAPH-TXT = '2002'. IGRAPH-VALUE = 06. APPEND IGRAPH.
    IGRAPH-TXT = '2003'. IGRAPH-VALUE = 34. APPEND IGRAPH.
    IGRAPH-TXT = '2004'. IGRAPH-VALUE = 45. APPEND IGRAPH.
    IGRAPH-TXT = '2005'. IGRAPH-VALUE = 66. APPEND IGRAPH.
    IGRAPH-TXT = '2006'. IGRAPH-VALUE = 15. APPEND IGRAPH.
    IGRAPH-TXT = '2007'. IGRAPH-VALUE = 17. APPEND IGRAPH.
    IGRAPH-TXT = '2008'. IGRAPH-VALUE = 30. APPEND IGRAPH.
    CALL FUNCTION 'GRAPH_2D'
      EXPORTING
        TITL   = TITLE
        VALT   = 'Value in EUR'
        WINSZX = '75'
        WINSZY = '75'
      TABLES
        DATA   = IGRAPH.
    CALL FUNCTION 'GRAPH_2D'
      EXPORTING
        TITL   = TITLE
        VALT   = 'Value in EUR'
        WINSZX = '75'
        WINSZY = '75'
        DISPLAY_TYPE = 'LN'
      TABLES
        DATA   = IGRAPH.
    CALL FUNCTION 'GRAPH_2D'
      EXPORTING
        TITL   = TITLE
        VALT   = 'Value in EUR'
        WINSZX = '75'
        WINSZY = '75'
        DISPLAY_TYPE = 'ST'
      TABLES
        DATA   = IGRAPH.
    and look in the Docu of this FM (Field DISPLAY_TYPE)
    Regards, Dieter

  • How to add line itme to sto delivery.

    Sd gurus,
    how do i add line time to the delivery after adding line item to STO?
    Im sure for STO we can t add line itme right there in the delivery it self..right?
    Please give me information.
    vivek

    Hi Vivek,
    As per my knowledge we cannot add the new line item in the same delivey...
    Becoz Delivery is created in backround. there is no specific copy controls set to change..
    its better to create a new delivery...
    hope you understand
    Muthu

  • How to plot line chart for huge xml files?

    Guys,
    I would like to plot files over 2000 lines in a line chart!
    but the application is getting very slow!
    does anyone have any tips to improve performance?

    Can we see how you implement the LineChart and bind the XML please?
    It should be fast normally.

  • How to generate line chart (e.g. stock market) in midlet?

    how to write such a line chart in midlet? any tutorial recommended?
    thanks a lot.

    Well, I would draw it myself. I think that's your only option. If you are not familiar with MIDP, then you should start with a beginner tutorial - it will not have anything to do with graphics, but more importantly it will introduce you to the programming model. You'll need the experience when you grapple with graphics. Not a big deal, but I haven't seen any samples for it, so you'll have to work off of the API docs. A nice page with sample programs:
    http://wireless.java.sun.com/midp/samples/
    If you are familiar with MIDP programming, or when you are, then hop over to the API and you'll find what you need there. Some simple math and some custom graphic routines/classes and you'll be well on your way. Here's the API location for the graphics class in the MIDP API:
    java.lang.Object
    |
    --javax.microedition.lcdui.Graphics
    Good luck. Hope this helped.

  • How to make line chart start at y-axis?

    How do you make the series on a line chart start at the y-axis?  I tried adding a data point for y(x=0), but the Xcelsius graph drops it and starts with y(x=1).  How do I fix that?  This is especially important for series that need to start at zero.

    Post Author: amr_foci
    CA Forum: Xcelsius and Live Office
    its all based on ur design of your Excel sheet
    design how it will be in Excel first
    then go to xeclsius
    ,,, by the way it looks very easy task
    you can do it.

  • How to draw Line Chart in SAP?

    There is a request that the customer want to see Line Chart in the report.
    Is it possible to do it using abap?
    Thank you very much.

    Hi,
    Yes it is possible.
    GOto Tcode SE83>Expand graphics node>double click on that
    you will get all graphic programs.

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • How to add line in PE51

    Dear Experts,
    Need your help in case added new lines in PE51.
    i tried increasing max line no from pe51_checktab tcode as there is few additional field requirement from my client,  i changed the number accordingly in this tcode. but im not getting the effect of same in pe51.
    I tried doing it through background/ attribute as well, but not able to add line in the existing form.
    Request you to kindly help me for the same.
    Kindly help.
    Rgds,
    Aarti
    Edited by: aartikshirsagar on Dec 21, 2010 7:40 AM

    Aarti,
    When you see it from GUI you are not able to see the whole scree.
    Width of payslip is around '255' charecters so you can't see whole payslip in single screen.
    Whatever you did it might have effected but there is a change it is in next screen.
    Please scroll the screen or run payroll for one person with this slip and check.
    Warm Regads

  • How to add lines to scatter/bubble chart?

    Hi,
    I have bubble and scatter charts for which I'd like to add some horizontal lines, such as sales goals. Anyone?
    Appreciate any suggestions/ideas.

    FileWriter(String fileName, boolean append) throws IOException
    If append is true, then output is appended to the end of the file. Here is an example:
    import java.io.*;
    public class  AATest1
         public static void main(String args[])
              try
                   //Open file for writing:
                   File data = new File("C:\\TestData\\javaIO.txt");
                   BufferedWriter out = new BufferedWriter(
                                  new FileWriter(data) );
                   out.write("hello");
                   out.close(); //flushes buffer
                   //Open file for appending:
                   out = new BufferedWriter(
                        new FileWriter(data, true) );
                   out.write(" world");
                   out.close(); //flushes buffer
              catch(IOException exc)
                   System.out.println("io error writing to file");
    }

Maybe you are looking for

  • Unable to Create Requestor ABCS using AIA Constructor in Jdev 11.1.1.2

    Hi Gurus, I'm currently trying to create ABCS Requester with J developer 11.1.1.2 using the AIA Service Constructor. The Composite Application shows the BPEL Component and the target services under the Composite screen.When we click on the BPEL Compo

  • Getting error-ORA-24381: error(s) in array DML

    Hi i have written the following code to bulk insert into a database table. I am getting an error while returning the result of the bulk insert query into the collection I have tried to track it by using sql%bulk_exceptions.error_code. But the error c

  • When in Bridge, my image processor won't work anymore

    When I am in Bridge I go to Tools>Photoshop>Image Processor and the dialog box doesn't come up anymore. It does nothing. I use Creative Cloud and all plugins are updated. Help!

  • PPC apps crashing in Snow Leopard

    I had to do a re-install from the Snow Leopard install disk, and now some PPC apps that worked fine before are crashing immediately on startup of the app. I get the familiar old message, "[app] Quit Unexpectedly. Click to Reopen..." When I did the re

  • Certificate not valid

    Hi I have a customer which is using Reader 7.0 Version 7.0.9 english. We have added the root certificate to his reader and configured that its valid for "Signatures and as trusted root" and "certified documents" in the certificate details I can see t