JavaFX 2.0: PieChart - display PieChart data values

Hi,
I try to work with PieChart:
ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(
               new PieChart.Data("Application ", 20),
               new PieChart.Data("Service ", 28),
               new PieChart.Data("Group ", 25)
PieChart chart = new PieChart(pieChartData);
chart.setClockwise(false);
chart.setLegendVisible(true);
As a result I get a pieChart with labels ("Application", "Service", "Group") which are the same as the pieChart's legend strings. I'd like to see on the pieChart it's values (20, 28, 25) , and not legend's strings I see now. I checked all possible documentation and didn't find how to do it. So, please, help me find solution for the problem. Thank you

it's not supported yet, i think.
here is a example may help you :
for (final PieChart.Data data : chart.getData()) {
    data.getNode().addEventHandler(MouseEvent.MOUSE_PRESSED,
        new EventHandler<MouseEvent>() {
            @Override public void handle(MouseEvent e) {
                caption.setTranslateX(e.getSceneX());
                caption.setTranslateY(e.getSceneY());
                caption.setText(String.valueOf(data.getPieValue()) + "%");
}[http://docs.oracle.com/javafx/2.0/charts/pie-chart.htm|http://docs.oracle.com/javafx/2.0/charts/pie-chart.htm]
Edited by: 906680 on 2012-3-7 下午5:05

Similar Messages

  • Display sound data value from ByteArrayOutputStream

    hi People,
    Can advise what is the function that i can use to retrieve or display the data that i stored in ByteArrayoutputStream buffer?
    So far i can only store the data in... but how can i retrieve and display them on output panel?
    Many Thanks

    Hi again,
    I have modify my code and found the error.. But this time i can't display the value correctly. Please advise...
    //This method captures audio input from a microphone and saves it in a ByteArrayOutputStream object.
    private void captureAudio(){
    try{
    //Get and display a list of available mixers.
    Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
    System.out.println("Available mixers:");
    for(int cnt = 0; cnt < mixerInfo.length; cnt++){
    System.out.println(mixerInfo[cnt].getName());
    }//end for loop
    //Get everything set up for capture
    audioFormat = getAudioFormat();
    DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class,audioFormat);
    //Select one of the available mixers.
    Mixer mixer = AudioSystem.getMixer(mixerInfo[3]);
    //Get a TargetDataLine on the selected mixer.
    targetDataLine = (TargetDataLine)mixer.getLine(dataLineInfo);
    //Prepare the line for use.
    targetDataLine.open(audioFormat);
    targetDataLine.start();
    //Create a thread to capture the microphone
    // data and start it running. It will run
    // until the Stop button is clicked.
    Thread captureThread = new CaptureThread();
    captureThread.start();
    } catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    }//end catch
    }//end captureAudio method
    public int[] ConvertSoundData (byte[] SoundData, int SampleTotal){
    //Determine the original Endian encoding format
    boolean isBigEndian = audioFormat.isBigEndian();
    //this array is the value of the signal at time i*h
    int x[] = new int[SampleTotal];
    int value;
    //convert each pair of byte values from the byte array to an Endian value
    for (int i = 0; i < SampleTotal*2; i+=2) {
    int b1 = SoundData;
         int b2 = SoundData[i + 1];
         if (b1 < 0) b1 += 0x100;
         if (b2 < 0) b2 += 0x100;
         //Store the data based on the original Endian encoding format
         if (!isBigEndian) value = (b1 << 8) + b2;
         else value = b1 + (b2 << 8);
         x[i/2] = value;
    return x;
    //This method creates and returns an
    // AudioFormat object for a given set of format
    // parameters. If these parameters don't work
    // well for you, try some of the other
    // allowable parameter values, which are shown
    // in comments following the declartions.
    private AudioFormat getAudioFormat(){
    float sampleRate = 8000.0F;
    //8000,11025,16000,22050,44100
    int sampleSizeInBits = 16;
    //8,16
    int channels = 1;
    //1,2
    boolean signed = true;
    //true,false
    boolean bigEndian = false;
    //true,false
    return new AudioFormat(
    sampleRate,
    sampleSizeInBits,
    channels,
    signed,
    bigEndian);
    }//end getAudioFormat
    //=============================================//
    //Inner class to capture data from microphone
    class CaptureThread extends Thread{
    //An arbitrary-size temporary holding buffer
    byte tempBuffer[] = new byte[10000];
    public void run(){
    byteArrayOutputStream = new ByteArrayOutputStream();
    stopCapture = false;
    try{//Loop until stopCapture is set by another thread that services the Stop button.
    while(!stopCapture){
    //Read data from the internal buffer of the data line.
    //targetDataLine.read(byte[] b, int off, int len)
    int cnt = targetDataLine.read(tempBuffer, 0, tempBuffer.length);
    if(cnt > 0){
    float sample_rate = audioFormat.getSampleRate();
    float T = audioFormat.getFrameSize() / audioFormat.getFrameRate();
    int n = (int) (sample_rate * T ) / 2;
    System.out.println(n); ---------> to print the number of sample
    //Save data in output stream object.
    byteArrayOutputStream.write(tempBuffer, 0, cnt);
    int[] SoundData = ConvertSoundData(tempBuffer,n);
    for(int index = 0; index < SoundData.length; index++){
    System.out.println(index + " " + SoundData[index]); ----------> to print the ALL sound data in the returned array.
    }//end if
    }//end while
    byteArrayOutputStream.close();
    }catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    }//end catch
    }//end run
    }//end inner class CaptureThread
    The result i got during i sing "hmmm" to my microphone is as below:
    1
    0 1281
    1
    0 61184
    1
    0 24830
    1
    0 25598
    1
    0 33279
    1
    0 25350
    1
    0 19728
    1
    0 54537
    Below is my question:
    1) Why the number of sample keep on remained as 1? Since the sampling frequency is 8000Hz..
    2) Why my index variable remained as 0? I suppose i will have 8000 values since my sampling rate is 8000Hz... Is it impossible to print 8000 data within 1 sec?
    Is it advisable if i transfer the obtained numeric array directly for FFT analysis?
    (I wish to do a real time frequency analyzer. With MATLAB, I can only do an analyzer by retrieving the .wav data content.)
    I am shame to say i am still not clear enough with the sampling and data retrieve algorithm. Thats why i will have difficulties to delliver correct idea.
    Appreciate if you have any tutorial can share with me so that i can understand more.
    Thank you again.

  • Safari Displays Unexpected Date Value

    I want to use the following script in my company website www.todoroffs.com, in order to always display the current year value within my copyright notice at the bottom of the pages:
    <script>
         var today=new Date()
         var todayy=today.getYear()
         document.write(""todayy"")
         </script>
    Safari displays the value "105" while other browsers display the desired value "2005".
    Furthermore, I want to use the following script which is a variant of the first script:
    <script>
         var today=new Date()
         var todayy=today.getYear()
         document.write(""todayy-1914"")
         </script>
    Safari displays the value "-1809" while other browsers display the desired value "91".
    Is this a bug in Safari? Is there a work-around?
    Thank you.

    Hi iBod,
    I am not familiar with getFullYear( ).
    I modified my code as follows:
    Copyright © 1997–getFullYear( )
    Safari and others display it as:
    Copyright © 1997–getFullYear( )
    What is the proper syntax and format?
    Thank you.

  • How to convert a date value into week value?

    How to display the date value like '20010203'
    into the week number of the year 2001?
    When i type in the following sql
    select week(chg_time) from site;
    I got this error message
    ORA-00904: invalid column name

    use the to_char function, to format the date into a week number (then you might need to convert that to a number using to_number)
    select to_char( sysdate, 'WW') from dual`
    a description of datetime formats: http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a90125/sql_elements4.htm#48515

  • Data values on Bar Chart in a BI Publisher report (11g)

    I have a bar chart that I created via the layout editor in BI Publisher 11g, and I'm displaying the data values on the chart. That part works great. However, we're noticing that the chart adds zeros to the end of the data values depending on the length of the number being passed to the chart. My data item is a number that is 5 bytes in total, with 2 decimals. If the data value is *10.10*, the data displayed on the bar chart shows *10.10*. But when my data value is *1.10*, the data displayed on the bar chart is *1.100*. And if my data value is *.10*, the bar chart displays *0.1000*. The bar chart adds zeros to the end as the number of characters to the left of the decimal decreases.
    I don't see a way to make it not do that. Has anyone else run into this, and been able to change it?

    Basically what are you trying to do :
    Attaching Mutiple Data Definition to a XML Program and deciding which one to call ased on parameter.Sorry you can not do that one Data DEfinition per Report.
    ut there is one way of doing that.
    Create multiple data defintion( mutiple programs) and then a master program something like
    IF Master Program Param1 = 'X'
    call BI Program 1
    ELSIF Master Program Param1 = 'Y'
    call I Program 2....
    End IF;

  • Dsiplay data values and data lables in a stacked column chart

    Hi All
    Is there a way to display data values and data labels in a stacked column chart. Mouse over or display of labels in legends wont help. It has to be in the chart .
    Regards,
    anshul

    Hi Anshul,
    You can display either data value or data label in a stacked column chart by checking the Data Label Displaying Mode option under Format Chart->Data Values.
    You can also do the same by checking the same option under Format chart->Area Display->Data Values.
    I dont think you would be able to display both in a column chart whereas you would be able to do it in a pie chart.
    Hope this helps.
    Regards
    Sri Harsha

  • ALV Report how to display from and to date values in the header.

    I develoeped alv report . i want to display selection screen from and to date values in  top of page...
    any sample code pls guide me..

    You have to do many things...
    first find the selection details using the FM.
    RS_REFRESH_FROM_SELECTOPTIONS
    use the Blog to Align/populate the Header  from the selection table
    /people/community.user/blog/2007/05/07/alignment-of-data-in-top-of-page-in-alv-grid

  • All Dates displayed for "Characteristic Values" in Query Designer

    Hello Experts,
    We are on BI 7.0, level 13.  I am having an issue within the Query Designer with regards to dates.  I have a write-optimized DSO that contains 3 date fields (for example, ZDATE1, ZDATE2, and ZDATE3).  Each date InfoObject is of type DATS so the system automatically creates it with reference to 0DATE. 
    When I create a query in the Query Designer, on the left hand side, I expand the "Characteristic Values" node under each date field.  The Query Designer shows the same list of values for each of the 3 dates even though they are not valid values posted in the DSO for those fields.
    For example, ZDATE1 only has 1 value posted in the DSO (01/01/2005).
    ZDATE2 only has 1 value posted in the DSO (01/01/2006).
    ZDATE3 only has 1 value posted in the DSO (01/01/2007).
    Bute when I expand the "Characteristic Values" node in the Query Designer, I see ALL THREE values under each date field.  I would expect to only see the 1 value posted for the InfoObject in the DSO.  Also note that each InfoObject is defined to show "Only posted values in InfoProvider".
    It appears that Query Designer will show all values for the reference InfoObject 0DATE instead of the ones posted to the actual InfoObject in the DSO.  If I delete the data in the DSO, the Characteristic Values list still remains because they exist in 0DATE.  Anyone encounter this before?  How can I get the Characteristic Values list to only show posted values for that InfObject?
    Thanks for your help!
    J

    Thanks for the response.  I went into the DSO and right clicked on each of the Date fields.  I looked at the Provider-specific properties and there is the option for "Query Exec.FilterVal" which only restricts what values appear when restricting during execution, not during query creation.
    Is there someplace else I should look or someplace else I can make change to only display posted dates when creating a query?  Thanks!

  • Smart data value display ? BUG sqldeveloper EA2 but works in plsqldeveloper

    Hi,
    The below mentioned debug facility works in plsqldevloper but the same does not work in sqldeveloper both on 10g and 11g Oracle Database
    Has anyone enocuntered this bug as smart data value / tooltip not displayed in sub proc while debug in
    sqldeveloper 3.0.02
    tooltip and values are dispalyed during debug in v_var1 but as u debug further to (sub procedure within the main procedure code) i.e procedure test1 ,values of v_var2 not being displayed in tool tip / smart data value until the debugger cursor comes out the sub procedure . Kindly replicate the example shown below in sqldevloper EA2
    create or replace
    PROCEDURE PROCEDURE1 AS
    v_var1 char(20);
    v_var2 char(20);
    v_var3 char(20);
    procedure test1 is
    begin
    v_var2 := 'this is sub proc' ;
    end test1;
    BEGIN
    v_var1 := 'this is a test';
    test1;
    END PROCEDURE1;
    Any comments/solution will be appreciated
    SS
    Edited by: user575518 on Jan 17, 2011 11:20 PM
    Edited by: user575518 on Jan 19, 2011 9:45 PM

    Hi,
    The below mentioned debug facility works in plsqldevloper but the same does not work in sqldeveloper both on 10g and 11g Oracle Database
    Has anyone enocuntered this bug as smart data value / tooltip not displayed in sub proc while debug in
    sqldeveloper 3.0.02
    tooltip and values are dispalyed during debug in v_var1 but as u debug further to (sub procedure within the main procedure code) i.e procedure test1 ,values of v_var2 not being displayed in tool tip / smart data value until the debugger cursor comes out the sub procedure . Kindly replicate the example shown below in sqldevloper EA2
    create or replace
    PROCEDURE PROCEDURE1 AS
    v_var1 char(20);
    v_var2 char(20);
    v_var3 char(20);
    procedure test1 is
    begin
    v_var2 := 'this is sub proc' ;
    end test1;
    BEGIN
    v_var1 := 'this is a test';
    test1;
    END PROCEDURE1;
    Any comments/solution will be appreciated
    SS
    Edited by: user575518 on Jan 17, 2011 11:20 PM
    Edited by: user575518 on Jan 19, 2011 9:45 PM

  • How to set Default value of a parameter  to display Current Date

    I need to display the Default value for my parameter 'As of Date' which is of datatype Date as Current Date[DD-MON-YYYY].
    How can I do This??

    As Tamir-L pointed out, there is no direct way to do this, but there is a workaround:
    First, create a new parameter, but do not base it on any item. Give the parameter a default value of "Today".
    Then, create a condition like:
       (    :myParam = 'Today'
        AND <date_item> = sysdate)
    OR (    <date_item> = to_date(:myParam, 'DD-MON-YYYY'))Where :myParam is the parameter you created, and <date_item> is the item you are comparing against.
    To make things a bit more bulletproof, you could create a calculation that returns sysdate when the parameter is 'Today', a date when the to_date is successful, and NULL when the to_date fails, and use the calculation in the condition.

  • How to display only Day value instead of DATE in Bex Report

    Hi Experts,
    We have a Month to date Report, in this report we need to display only day value instead of DATE value,
    Like
    if Date is 14.05.2010 we need to show only  14
    Regards,
    Chandra

    Hi ,
    Thanks for Quick Response
    we does have the option to create the char(calday or ...) value variable replacement with char (calday or ...) info object, we can  replace with Report r variable value only not with info object.
    i hope we can replace the with info object only with formula variable with replacement.
    My BEx Report is Designed like
    Columns
    0Calday
    Rows
    Plant
    Keyfigures
    Actual
    Plan
    Report output Looks like month to date
    0CALDAY            01.06.2010   02.06.2010  03.06.2010
    P1  ACTUAL            10                     8                    4
    P1  PLAN                 15                     6                    2
    P2  ACTUAL              5                   10                     7
    P2  PLAN                  4                      8                    3
    Report should be
    0CALDAY            1    2     3
    P1  ACTUAL      10     8      4
    P1  PLAN           15     6     2
    P2  ACTUAL        5    10    7
    P2  PLAN            4      8     3
    please let me know how can i achive this
    Regards
    Chandra

  • SAP Dashboards - Area graph- Data values display - x-axis 1st value is not showing

    Hi
    Not able to show the first data value in area graph. 2500 is not showing in the chart...remaining values able to display...
    Kindly let us know, is there any specific setting to be done....

    Hi sunil,
    Your question has the answer. When we display same data in line chart or bar chart, you have the space to start displaying the value. But in this case the area chart will accumulate the whole chart to show the lagging & leading data from the start to end, so you cannot view the initial value to display.  If this chart doesn't suits your requirement you can go with other charts.
    The workaround will be like, if the month's are static like will you be displaying all twelve months in this chart then i would request you to take twelve text components in top of the chart or in any comfortable space where you can bind those value.
    Hope this information is helpful.

  • Not to display the null values from data base

    Hiiii.
    In a jsp file i have ten check boxes.The jsp file is mapped to a servlet file for parameter requesting and to
    store it in DB.
    The unchecked box values has null values.All the values are store in a Mysql DB table.
    Again i have to display it in a jsp page from table.
    The problem am facing was,how can i display only the values in a row.it must not display the null values and the crresponding column name.
    Or any other way is their like below
    How i can retrieve only the selected check boxes from tht jsp file.and store in backend.
    Thanks in Advance
    regards,
    satheesh kannan

    Here is a rough example that may give you some ideas:
    On the JSP page:
    <%if(myData.getFirstName()!=null){%>
    Your First Name'
    <input type="text" name="firstName" value="<%=myData.getFirstName()%>">
    <%}%>
    In the servlet:
    String firstName= request.getParameter("firstName");
    if(firstName!=null){
    //write it to the database
    }

  • Is there any possible that pivot table can display date values in the data area like this?

    I use Power Query to load data(including all the of data showed in the following table without accumulating) from database to the Excel Worksheet, and I want to build a pivot table like this.
    But the data area of the pivot table can only accecpt and display numeric data. Is there any possible that such a display can be achieved?
    Thanks.

    Hi,
    Would you like to upload a sample file through OneDrive? I'd like to see the data source structure and test it.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Strange scenario,Oracle can not display the data in mysql correctly

    I use Heterogeneous Service+ODBC to achieve "oracle access mysql"(any other method?),and now i find Oracle can not display the data in mysql correctly:
    -------mysql------------
    mysql> create table tst(id int,name varchar(10));
    Query OK, 0 rows affected (0.00 sec)
    mysql> insert into tst values(1,'a');
    Query OK, 1 row affected (0.00 sec)
    mysql> select * from tst;
    ------------+
    | id | name |
    ------------+
    | 1 | a |
    ------------+
    1 row in set (0.00 sec)
    mysql> show create table tst\G
    *************************** 1. row ***************************
    Table: tst
    Create Table: CREATE TABLE `tst` (
    `id` int(11) DEFAULT NULL,
    `name` varchar(10) DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8
    1 row in set (0.00 sec)
    -------------oracle ------------------
    SQL> select count(*) from "tst"@mysql;
    COUNT(*)
    49
    SQL> select * from "tst"@mysql;
    id
    1
    SQL> desc "tst"@mysql;
    Name Null? Type
    id NUMBER(10)

    You can make the following query on the result page:
    "select * from the_table where movietitle = ? and cinema = ?"
    then you set movietitle and cinema to those which the user selected. If the resultset contains more than 0 rows, that means the movie is available.
    Below is the sample code, it assumes you have a connection to the database:
    PreparedStatement stat = myConnection.prepareStatement("select * from the_table where movietitle = ? and cinema = ?");
    stat.setString(1, usersMovieTitleSelection);
    stat.setString(2, usersCinemaSelection);
    ResultSet res = stat.executeQuery();
    if (res.next()) {
    out.print("The movie is available");
    } else {
    out.print("The movie is not available");
    }Now just add that to your JSP page. Enjoy ! =)

Maybe you are looking for