Responsive Charts

Hi
I'm trying to make charts responsive in APEX 4.2.1.
The problem is that you can't define percentage values in the apex builder for the width and the height of the chart.
Now when I look in the javascript source code (#IMAGE_PREFIX#libraries/apex/widget_chart.js), I see that the code is there to use precentage values and make it responsive, but I can't use it in the builder.
I implemented a work around, but this is probably not the best way to solve the issue:
$('#CHART_chart').empty();
(function(){apex.widget.chart("CHART",{"type":"FLASH_PREFERRED","swfFile":"\u002Fo\u002Fflashchart\u002Fanychart_6\u002Fswf\u002FOracleAnyChart.swf","preloaderFile":"\u002Fo\u002Fflashchart\u002Fanychart_6\u002Fswf\u002FPreloader.swf","width":"100%","height":"99%","regionId":"6993781449104204150"});})();
I delete the orignal chart and re-create it with the same code as apex uses only with percentage values for the width and the height. The regionId should still be dynamically retrieved.
Of course this not the best solution because it does the same code twice (and ajax request).
So my question is: does anyone have a better solution?
It would be nice if you could use percentage values in the next release of apex. :)
Greetings
Stijn VR
Edited by: Stijn on 18-jan-2013 1:19

From APEX 4.2.1 on you can omit width/height settings, when using HTML5 charts. In that case the chart uses the full region-size.
Depending on your Theme/Template that can be what you are looking for.
brgds,
Peter
get Syntax Highlighting for the Application Builder: http://apex.oracle.com/pls/apex/f?p=APEX_DEVELOPER_ADDON:ABOUT:0:::::
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at and http://www.wirsindapex.at
Fantastic Plugins for APEX: http://www.tryfoexnow.com

Similar Messages

  • Can we see dynamic data on charts using Excel Services

    hi all,
    i would like to know if there is any option in SharePoint 2013 for developing dynamic "responsive/interactive Charts"  with SQL server as data source. And the connection should be there online, i mean the charts should refresh data based on
    the SQL data all the time. 
    When i saw the feature of excel service, i could see only retrieving of data using data connection from sql and after adding that data to workbook, we can create responsive charts with required filters. However, i dint see option of data refresh from external
    source without opening the excel work book. 
    What i want is, once i added the chart using chart webpart, if any new data is added or modified in external data source i.e., like SQL in my case, the chart should automatically updated with new changes in the data.
    please let me know if my requirement can be fulfilled using OOB.
    thank you beforehand .
    Thanks & Regards Raj

    Hi ALL,
    Linda, I know you are only trying to help but when you answer questions where you don't know the answer you only mislead the user asking the question at best but every one else who reviews the post... we have been performing data refresh on page
    render and every 5 minutes by default since SharePoint 2007. We build Business Intelligence Dashboards and Score Cards using Live data with Excel Services, and features like PowerPivot, PowerView
    Data in a Microsoft Office Excel workbook that has been displayed in Excel Services can come from two different locations. The data may be stored directly in the workbook, or it may be stored in an external data source, such as in a database or
    in an Online Analytical Processing (OLAP) cube.
    If the data comes from an external data source, the workbook author or administrator has defined the connection information, often in an Office data connection (.odc) file, which describes how to locate, log in, query, and access the external data source.
    When you are connected to an external data source, you can perform a refresh operation to retrieve the updated data. Each time that you refresh data, you see the most recent version of the data, including any changes that were made to the data since it was
    last refreshed.
    Refresh all connections
    On the Excel Web Access toolbar, under the Update menu, click
    Refresh All Connections.
    Periodic refresh
    By using Office Excel 2007, the workbook author can specify that data automatically refreshes at a specified interval after the workbook is opened for each connection in the workbook. For example, an inventory database may be updated every hour, and so the
    workbook author has defined the workbook to automatically refresh every 60 minutes. For more information, see Microsoft Office Excel 2007 Help.
    A Web Part author can select or clear the Allow Excel Web Access Periodic Data Refresh property to enable or disable this periodic refresh operation, if the property has been defined by the workbook author. When the time interval elapses,
    by default, the following refresh alert prompt is displayed at the bottom of the Excel Web Access Web Part:
    Refresh data for <List of Connections>? (Now) (Always) (Don't ask me again)
    An Excel Web Access Web Part author can also set the Display Periodic Data Refresh Prompt property to control the behavior of the message that is displayed when Excel Services performs a periodic data refresh during a session:
    Always      means that the message is displayed with a prompt at each interval.
    Optionally      means that a user can choose to continue periodic refresh without displaying a message.
    Never      means that Excel Web Access performs a periodic refresh without displaying a message or prompt.
    For more information, see
    Excel Web Access Web Part custom properties.
    I have only listed a couple of the ways you can have Excel services update external data, this is not an exhaustive list
    Data Refresh with Excel Services Reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/refresh-external-data-in-excel-services-HA010105474.aspx
    http://office.microsoft.com/en-us/sharepoint-help/work-with-external-data-in-excel-services-sharepoint-server-HA102830785.aspx
    http://technet.microsoft.com/en-us/library/jj879294.aspx
    -Ivan

  • URGENT : java exception

    hello
    I have a quiz system that has a server, a player and a friend client. I have tried running them( by directly running their main classes) it works fine.
    However when i load a player and a friend client from a main interface by clicling on their respective jButton, the respective interfaces are loaded but i get the following error:
    Exception in thread "Thread-3" java.lang.NullPointerException
    at playerQuiz.src.QuizClient.run(QuizClient.java:318)
    at java.lang.Thread.run(Thread.java:595)
    But as i have already mentioned the program works perfectly when not loaded from a button.
    can someone please help.
    Edited by: ojm22 on Jun 8, 2008 2:21 AM

    The class QuizClient :
    package playerQuiz.src;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class QuizClient extends JFrame implements ActionListener, Runnable {
        String moneySum[] = {"5", "10", "20", "30", "40", "45", "50", "55",
                             "60", "70", "75", "80",
                             "85", "90", "95", "100 "};
        static PrintStream out;         // for sending to server.
        static BufferedReader in;       // for getting data from server.
        // socket for connection with the server:
        static Socket socket = null;
        // label to show status messages:
        JLabel lblStatus = new JLabel("Connected! Waiting for a friend...", JLabel.CENTER);
        // label to show questions:
        JLabel lblQuestion = new JLabel(" ", JLabel.CENTER);
        // label to just to show "wheels" label:
        JLabel lblWheels = new JLabel("  Wheels");
        // label to show how many friend wheels are left:
        JLabel lblFriend = new JLabel("  Friend:   ?");
        // label to show how many 50:50 wheels are left:
        JLabel lbl5050 = new JLabel("  50:50 :   ?");
        // label to show how many wheels of the public are left:
        JLabel lblThePublic = new JLabel("  Public:   ?");
        // answer boxes for possible answers:
        AnswerBox cbAnswers[] = new AnswerBox[4];
        // buttons:
        JButton btnFinal, btnFriend, btn5050, btnThePublic, btnRetire;
        // money boxes:
        PointBox cbMoney[] = new PointBox[15];
        // response chart for the public:
        Chart publicChart = new Chart();
        int selectedAnswer = -1; // last clicked answer.
        int moneyIndex = 0;    // money index, updated by server.
        // will be true when friend will also be connected:
        public boolean ALL_CONNECTED = false;
        // thread which cares about receiving data from server:
        Thread thServer = null;
        * Default Constructor.
        public QuizClient()
            super ("The Revision Quiz");
            // look & feel setup:
            try {
                UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName() );
            } catch (Exception e) {
                System.err.println("Couldn't use the system "
                                 + "look and feel: " + e);
            // update look & feel for those components created in
            //     declaration (if required):
            lblStatus.updateUI();
            lblQuestion.updateUI();
            lblWheels.updateUI();
            lblFriend.updateUI();
            lbl5050.updateUI();
            lblThePublic.updateUI();
            // processing window events:
            WindowListener L= new WindowAdapter () {
                public void windowClosing(WindowEvent e) {
                    closeApplication();
            addWindowListener(L);
            // prepare the layout:
            JPanel  pMain = new JPanel ();
            pMain.setLayout(new BorderLayout());
            JPanel pUpper = new JPanel();           // for labels.
            pUpper.setLayout(new GridLayout(2,1));
            JPanel  pCenter = new JPanel ();        // for answers.
            pCenter.setLayout(new BorderLayout());
            JPanel pAnswers = new JPanel();           // for answers & the public chart.
            pAnswers.setLayout(new GridLayout(2,2, 20,20));
            // for buttons:
            JPanel pButtons = new JPanel(new FlowLayout(FlowLayout.CENTER,10,10));
            JPanel pLeft = new JPanel(new GridLayout(15,1, 10,10));  // for wheels counters.
            JPanel pRight = new JPanel(new GridLayout(15,1, 1,1));   // for money boxes.
            pUpper.add(lblStatus);
            pUpper.add(lblQuestion);
            pLeft.add(lblWheels);
            pLeft.add(lblFriend);
            pLeft.add(lbl5050);
            pLeft.add(lblThePublic);
            // make & add check boxes for answers:
            cbAnswers[0] = new AnswerBox ("A:",pAnswers);   // first possible answer.
            pAnswers.add(cbAnswers[0]);
            cbAnswers[0].addActionListener(this);
            cbAnswers[1] = new AnswerBox ("B:",pAnswers);   // second possible answer.
            pAnswers.add(cbAnswers[1]);
            cbAnswers[1].addActionListener(this);
            cbAnswers[2] = new AnswerBox ("C:",pAnswers);   // third possible answer.
            pAnswers.add(cbAnswers[2]);
            cbAnswers[2].addActionListener(this);
            cbAnswers[3] = new AnswerBox ("D:",pAnswers);   // fourth possible answer.
            pAnswers.add(cbAnswers[3]);
            cbAnswers[3].addActionListener(this);
            // make & add buttons:
            btnFinal = new JButton("Final");        // for confirmation of answer.
            pButtons.add(btnFinal);
            btnFinal.addActionListener(this);
            btnFriend = new JButton("Friend");      // for friend request.
            pButtons.add(btnFriend);
            btnFriend.addActionListener(this);
            btn5050 = new JButton("50:50");         // for 50:50 request.
            pButtons.add(btn5050);
            btn5050.addActionListener(this);
            btnThePublic = new JButton("The Public");   // for request of the public.
            pButtons.add(btnThePublic);
            btnThePublic.addActionListener(this);
            btnRetire = new JButton("Retire");      // for request to retire.
            pButtons.add(btnRetire);
            btnRetire.addActionListener(this);
            enableButtons(false);     // disable all buttons.
            // make money boxes:
            for (int i=14; i>=0; i--) {
                cbMoney[i] = new PointBox (moneySum[i+1], pRight);
                pRight.add(cbMoney);
    cbMoney[4].setStopStation(); // "1,000"
    cbMoney[9].setStopStation(); // "32,000"
    pCenter.add (pAnswers, BorderLayout.SOUTH);
    // add response chart for the public:
    publicChart.setVisible(false); // shown only when required.
    pCenter.add (publicChart, BorderLayout.CENTER);
    // Add sub layouts to main layout:
    pMain.add(pUpper, BorderLayout.NORTH);
    pMain.add(pButtons, BorderLayout.SOUTH);
    pMain.add(pCenter, BorderLayout.CENTER);
    pMain.add(pLeft, BorderLayout.WEST);
    pMain.add(pRight, BorderLayout.EAST);
    // -------- set colors and fonts:
    pButtons.setBackground(Color.lightGray );
    pAnswers.setBackground(Color.lightGray );
    pCenter.setBackground(Color.lightGray );
    pUpper.setBackground(Color.lightGray );
    pRight.setBackground(Color.lightGray) ;
    pLeft.setBackground(Color.lightGray);
    lblStatus.setForeground(Color.yellow);
    lblQuestion.setForeground(Color.black);
    lblWheels.setForeground(Color.green);
    lblFriend.setForeground(Color.white);
    lbl5050.setForeground(Color.white);
    lblThePublic.setForeground(Color.white);
    Font f1 = new Font("Arial", Font.BOLD, 12);
    Font f2 = new Font("Arial", Font.BOLD, 20);
    lblStatus.setFont(f1);
    lblQuestion.setFont(f2);
    lblWheels.setFont(f1);
    lblFriend.setFont(f1);
    lbl5050.setFont(f1);
    lblThePublic.setFont(f1);
    // show the window:
    setContentPane (pMain);
    setSize(590,450);
    setVisible(true);
    // start the thread that cares about receiving data from server:
    thServer = new Thread (this);
    thServer.start();
    * Main function, from where QuizClient starts.
    public static void main(String args[]) {
         String serverAddress = "172.22.45.120";
         int serverPort = 4450;
         try {
                   socket = new Socket(serverAddress, serverPort);
              } catch (UnknownHostException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              } catch (IOException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    System.out.println(socket);
    // open in and out streams for talking with the server:
    try {
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    out = new PrintStream(socket.getOutputStream());
    catch (IOException e) {
    System.err.println("Open streams -> " + e);
    System.exit(1);
    // print the address of player - for verification:
    InetAddress localHost = null;
    try {
    localHost = InetAddress.getLocalHost();
    } catch (UnknownHostException e) {
    System.out.println("Unknown host - probably localhost with no IP!");
    // no exit, since can work on "localhost" without internet.
    System.out.println("Player's local address: " + localHost);
    // create QuizClient and show its window:
    new QuizClient();
    private void pause(int time) {
    try {
    Thread.sleep(time);
    catch (InterruptedException e) {
    System.err.println(e.getMessage());
    * The run method of that is used by a thread.
    public void run() {
    Thread thisThread = Thread.currentThread();
    // thread which cares about receiving data from server:
    while (thServer == thisThread) {
    String serverInput;
    try {
    if ((serverInput = in.readLine()) != null)
    gotMessageFromServer(serverInput); // trigger "event".
    catch (IOException ioe) {
    JOptionPane.showMessageDialog(this,
    ioe + "\nNot regular game termination!",
    "Cannot read from server!",
    JOptionPane.ERROR_MESSAGE);
    closeApplication(); // force to close.
    } // end of run().
    public void actionPerformed(ActionEvent e){
    Object src=e.getSource();
    if (src == btnFinal) {            // confirmation of answer.
    if (selectedAnswer != -1) {
    enableButtons(false); // disable all buttons.
    lblStatus.setText("Waiting for server's response...");
    sendToServer("FINAL:" + selectedAnswer);
    else {
    JOptionPane.showMessageDialog(this,
    "Please select an answer!",
    "Not selected!", JOptionPane.ERROR_MESSAGE);
    else if (src == btnFriend) {     // friend request.
    enableButtons(false); // disable all buttons.
    lblStatus.setText("Waiting for friend's response...");
    sendToServer("FRIEND");
    else if (src == btn5050) {        // 50:50 request.
    enableButtons(false); // disable all buttons.
    lblStatus.setText("Waiting for server's response...");
    sendToServer("50:50");
    else if (src == btnThePublic) {   // request of the public.
    enableButtons(false); // disable all buttons.
    publicChart.setChart(0, 0, 0, 0); // reset the chart from any data.
    publicChart.setVisible(true); // show the chart.
    lblStatus.setText("Waiting for server's response...");
    sendToServer("THE_PUBLIC");
    else if (src == btnRetire) {     // request to retire.
    enableButtons(false); // disable all buttons.
    lblStatus.setText("Waiting for server's response...");
    sendToServer("RETIRE");
    else{
    // clicks on check-boxes:
    for (int i=0; i<4; i++)
    if (cbAnswers[i] == src) {  // click on one of the answer boxes.
    selectedAnswer = i+1; // +1 because first is 1.
    // deselect any other selected check-boxes
    // except the last one:
    for (int k=0; k<4; k++) {
    if (k != i) // not equal to selected.
    cbAnswers[k].setSelected(false);
    else
    cbAnswers[k].setSelected(true);
    return; // no need to continue.
    } // end of actionPerformed().
    private void setMoney(String sm) {
    int k;
    try {
    k = Integer.parseInt(sm);
    catch(NumberFormatException e) {
    System.err.println("setMoney()--> " + e);
    return;
    // validation (should be between 0 and 15):
    if ((k > 15) || (k < 0)) {
    System.err.println("setMoney() out of bounds --> " + sm);
    return;
    moneyIndex = k; // store in global variable.
    updateEarnedMoney();
    private void updateEarnedMoney() {
    // select earned stations:
    for (int i=0; i<moneyIndex; i++)
    cbMoney[i].setSelected(true);
    // clear all the others:
    for (int i=moneyIndex; i<15; i++)
    cbMoney[i].setSelected(false);
    private void gotMessageFromServer(String msg) {
    System.out.println("SERVER: [" + msg + "]");
    if (msg.equals("ALL_CONNECTED")) {   // game started.
    ALL_CONNECTED = true;
    sendToServer("RESTART"); // reset everything.
    sendToServer("QUESTION"); // ask for first question.
    else if (msg.startsWith("Q:")) {    // question.
    prepareForNextQuestion();
    lblQuestion.setText(extractData(msg));
    else if (msg.startsWith("A1:")) {       // first possible answer.
    cbAnswers[0].setText(extractData(msg));
    else if (msg.startsWith("A2:")) {       // second possible answer.
    cbAnswers[1].setText(extractData(msg));
    else if (msg.startsWith("A3:")) {       // third possible answer.
    cbAnswers[2].setText(extractData(msg));
    else if (msg.startsWith("A4:")) {       // fourth possible answer.
    cbAnswers[3].setText(extractData(msg));
    // got last possible answer, so enable buttons:
    enableButtons(true);
    lblStatus.setText(" "); // clear the status.
    else if (msg.startsWith("MONEY:")) {    // earned money index.
    setMoney(extractData(msg));
    else if (msg.startsWith("FRIEND:")) {  // how many friend tips left.
    lblFriend.setText (" Friend: " + extractData(msg));
    else if (msg.startsWith("50_50:")) {  // how many 50:50 tips left.
    lbl5050.setText (" 50:50 : " + extractData(msg));
    else if (msg.startsWith("THE_PUBLIC:")) {  // how many tips of the public left.
    lblThePublic.setText (" Public: " + extractData(msg));
    else if (msg.equals("NOFRIEND!")) {     // error - no more friend tips!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server says you have no more friend tips, sorry.",
    "No more friend tips", JOptionPane.ERROR_MESSAGE);
    enableButtons(true);
    else if (msg.equals("NO50:50!")) {      // error - no more 50:50 tips!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server says you have no more 50:50 tips, sorry.",
    "No more 50:50 tips", JOptionPane.ERROR_MESSAGE);
    enableButtons(true);
    else if (msg.equals("50:50TWICE!")) {   // error - 50:50 done twice already!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server says you have done 50:50 twice already for this question!",
    "Cannot do 50:50 three times for one question", JOptionPane.ERROR_MESSAGE);
    enableButtons(true);
    else if (msg.equals("NO_PUBLIC!")) {    // error - no more tips of the public!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server says you have no more tips of the public, sorry.",
    "No more tips of the public!", JOptionPane.ERROR_MESSAGE);
    enableButtons(true);
    publicChart.setVisible(false); // hide the chart (it's empty).
    else if (msg.startsWith("GREEN:")) {   // set right answer be green.
    try { // generally, server sends the right data, check anyway
    int k = Integer.parseInt(extractData(msg));
    cbAnswers[k-1].setCorrect();
    } catch (Exception e) {
    System.out.println("GREEN: -> " + e);
    else if (msg.equals("RIGHT!")) {      // last question was answered correctly!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "This is the right answer!",
    "Congratulations!", JOptionPane.INFORMATION_MESSAGE);
    lblStatus.setText("Waiting for server's response...");
    sendToServer("QUESTION"); // ask for next question.
    else if (msg.equals("MILLION!")) {    // correct, and you won a million!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "You passed with Distinction!",
    "Congratulations! - Game over.", JOptionPane.INFORMATION_MESSAGE);
    askToRestart();
    else if (msg.startsWith("WRONG!:")) { // last question was answered WRONG!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Your answer is wrong!\n Correct answer is " +
    indexToLetter( extractData(msg) ) +
    "\nYour current marks is \t" + moneySum[moneyIndex],
    "Game over!", JOptionPane.ERROR_MESSAGE);
    askToRestart();
    else if (msg.startsWith("RETIRED:")) { // retire request confirmed.
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Your current marks is" + moneySum[moneyIndex] + ",\n" +
    "and the right answer for the last question is " +
    indexToLetter ( extractData(msg) ),
    "Retired!", JOptionPane.INFORMATION_MESSAGE);
    askToRestart();
    else if (msg.startsWith("FRIEND_ANSWER:")) {    // getting friend answer.
    lblStatus.setText("Your friend thinks answer is: " +
    indexToLetter( extractData(msg) ) );
    // got answer from friend, so enable the buttons:
    enableButtons(true);
    else if (msg.equals("FRIEND_DONTKNOW")) {       // friend doesn't know!
    lblStatus.setText("Your friend doesn't know the answer...");
    // friend says he doesn't know, so enable the buttons:
    enableButtons(true);
    else if (msg.equals("FRIEND_TIMEUP")) {         // friend's time is up!
    lblStatus.setText("Your friend failed to give answer in 30 seconds...");
    // time is up, so enable the buttons:
    enableButtons(true);
    else if (msg.startsWith("TIMER:")) {            // timer state for friend.
    lblStatus.setText("Your friend has: " + extractData(msg) + " seconds.");
    else if (msg.startsWith("Message from Server:")) {
    lblStatus.setText(msg);
    else if (msg.equals("FRIEND_DISCONECTED")) {    // error - friend disconected.
    // though the game can be continued without the friend,
    // we decided to end the game to avoid processing the state
    // when friend is required and it's not there....
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Your Friend has disconnected!\n" +
    "Server terminated the game.",
    "Friend disconnected!",
    JOptionPane.ERROR_MESSAGE);
    closeApplication(); // force to close.
    else if (msg.equals("WATING_PREV_FRIEND")) {    // error - server not ready!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server still waits for a connection of Friend" +
    " for previous game that has not connected yet!\n" +
    "Try again later...",
    "Server not ready!",
    JOptionPane.ERROR_MESSAGE);
    closeApplication(); // force to close.
    else if (msg.equals("TERMINATED")) {        // server terminates our game!
    lblStatus.setText(" "); // clear the status.
    JOptionPane.showMessageDialog(this,
    "Server terminated your game for no obvious reason!",
    "Game terminated!",
    JOptionPane.ERROR_MESSAGE);
    closeApplication(); // force to close.
    else if (msg.startsWith("CANCEL1:")) {   // 50:50 first canceled answer
    try {
    String index = extractData(msg);
    cbAnswers[Integer.parseInt(index)-1].setText(" "); // clear.
    } catch (Exception e) {
    System.err.println("CANCEL1: -> " + e);
    else if (msg.startsWith("CANCEL2:")) {   // 50:50 another canceled answer
    try {
    String index = extractData(msg);
    cbAnswers[Integer.parseInt(index)-1].setText(" "); // clear.
    } catch (Exception e) {
    System.err.println("CANCEL2: -> " + e);
    // clear the status & enable the buttons:
    lblStatus.setText(" ");
    enableButtons(true);
    else if (msg.startsWith("BAR1:")) {  // help of the public (% for "A").
    publicChart.setChart(extractData(msg), 1);
    else if (msg.startsWith("BAR2:")) {  // help of the public (% for "B").
    publicChart.setChart(extractData(msg), 2);
    else if (msg.startsWith("BAR3:")) {  // help of the public (% for "C").
    publicChart.setChart(extractData(msg), 3);
    else if (msg.startsWith("BAR4:")) {  // help of the public (% for "D").
    publicChart.setChart(extractData(msg), 4);
    // assumed that "BAR4:?" is received as the last bar, so
    // clear the status & enable the buttons:
    lblStatus.setText(" ");
    enableButtons(true);
    public void sendToServer(String msg) {
    if (thServer == null) // shuting down?
    return;
    out.println(msg);
    // Flush the stream and check its error state:
    if (out.checkError())
    System.err.println("Cannot send -> " + msg);
    else
    System.out.println("SEND: " + msg);
    * Asks user if he/she want's to restart the game.
    * If the answer is "yes", starts new game.
    private void askToRestart() {
    int result;
    result = JOptionPane.showConfirmDialog(this,
    "Would you like to play again?",
    "Play again?",
    JOptionPane.YES_NO_OPTION,
    JOptionPane.QUESTION_MESSAGE);
    if (result == 0) {  // yes, restart.
    lblStatus.setText("Waiting for server's response...");
    sendToServer("RESTART"); // reset everything.
    sendToServer("QUESTION"); // ask for a question.
    else {              // no, close connection.
    closeApplication(); // close connection, and exit.
    * Closes this Game Client station.
    private void closeApplication() {
    // inform the server:
    sendToServer("CLOSE");
    thServer = null; // stop the thread.
    try {
    // close server streams:
    out.close(); // close stream that sends data to server.
    in.close(); // close stream that gets data from server.
    // close socket connected to server:
    if (socket != null)
    socket.close();
    } catch (IOException e) {}
    // close everything:
    System.exit(0);
    * Enables (or disables) all buttons.
    * @param b when true enables, otherwise disables.
    private void enableButtons (boolean b) {
    btnFinal.setEnabled(b);
    btnFriend.setEnabled(b);
    btn5050.setEnabled(b);
    btnThePublic.setEnabled(b);
    btnRetire.setEnabled(b);
    * Prepares the GUI for the next question,
    * hides the chart, resets question field, and possible
    * answers.
    private void prepareForNextQuestion() {
    publicChart.setVisible(false);
    lblQuestion.setText(" ");
    for (int i=0; i<cbAnswers.length; i++) {
    cbAnswers[i].setText("");
    cbAnswers[i].setSelected(false); // reset selected check box.
    selectedAnswer = -1;
    private String indexToLetter(String index) {
    String sANSWERS[] = {"\"A\"", "\"B\"", "\"C\"", "\"D\""};
    try {
    return sANSWERS[Integer.parseInt(index)-1];
    } catch (Exception e) {
    System.err.println("indexToLetter -> " + e);
    return "?";
    private static String extractData(String msg) {
    try {
    int i = msg.indexOf(':'); // get index of first ':'.
    return msg.substring(i+1); // return second token.
    catch(Exception e) {
    return ""; // in case of error return empty string.
    } // end of class.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Flash-based MP3 player with specified frequency respon

    I'm looking into buying a flash-memory based MP3 player. I'm trying to get a quality player that has linear audio output. I am usually listening to Baroque music, both from CDs and from my own recordings. Here are my detailed requirements:
    - USB 2.0 hi-speed
    - flash memory
    - powered by standard batteries (AAA or AA)
    - specified frequency response, S/N ratio and THD
    For example, on the Zen Nano Plus specifications web page, I read
    - Signal to Noise Ratio: up to 90dB
    - Frequency Response: 20Hz to 20kHz
    - Harmonic Response Output: 0.%
    This appears quite weasel-wordy. For example, a S/N ratio of "up to" something says nothing ("I am up to 00 years old"), reasonable wording would be "S/N ratio of at least x dB". The frequency response does not specify the attenuation over the given frequency range, -30dB at 20Hz would not be ruled out. I prefer frequency response charts that show the function "attenuation (dB) over frequency on log scale". For example, those are readily available for many headphones and all reasonable microphones. Further, I can only guess that "Harmonic Response output" means THD. Moreover, there is no data for stereo separation/crosstalk.
    Since these data points relate to the headphones output of the MP3 player, measuring them is fairly easy, since no actual sound waves are produced.
    Has anyone measured any of the Creative flash products and can post the respecti've charts and data?

    Thank you for your answers.
    Yes, I'm technically minded (I'm German, in case you think that explains it :-) I just posted hoping for the off-chance that someone was curious enough to have performed some real measurements.
    The idea for generating the WAV file would be NOT to try to record a real oscillator, but instead create the WAV file with a PC audio editor where you can say "give me a kHz tone for 0 seconds". You would do this on a log scale from, say 20 Hz to 20 kHz, save as WAV, move the resulting file to the MP3 player, play it, and check the output levels for each frequency. Calculating THD is probably more ambitious, but if your 'scope shows some frequency skew, that would probably be interesting, too. I don't know whether a traditional 'scope has enough amplitude resolution to deal with 90 dB S/N ratio (that's a factor of 30000 between signal and noise floor).
    I don't think I can attach files

  • 3D real time voltage graph

    Hi I'm a beginner at Labview.
    I'd like to plot a real time contour graph from voltage readings from 4 diodes which is obtained via the DAQ. The x-y coordinates are the coordinates of the locations of the diodes while the z coordinate is the (current) voltage measurement of each diode.
    I've already splitted up my location coordinates into x-vector and y-vector. I've tried to wire my latest readings values into the z matrix, however I received an error about the different data types.
    Any idea how can I plot a 3D real time contour graph?
    Ps. With the exception of the 3D graph, everything else works prefectly.
    Attachments:
    voltage array 2 - Copy.vi ‏122 KB

    jsp6 wrote:
    Hello,
    I'm trying to view the voltage measurements in real-time chart. (Labview2012 and I've connected 2400 sourcemeter with my laptop by using GPIB-USB-HS)
    My question is, how can I increase the chart update rate? Say, how can I increase samples/second rate?
    Here is the screenshot of my chart -> . Its update rate is quite slow and I dont know why the voltage measurement takes time to settle back 0V (notice the descending slop after the voltage pulse).
    I'm using labview to measure a voltage pulses. So I need fast-response chart that looks like this -> .
    I'm very new to Labview. Please help 
    I'm attaching the vi
    Are you sure they're the same timescale?  The LabVIEW shot sure looks like a time-stretched version of the display photo...
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • IChart Pie Chart doesn't response to SelectionEvent

    Hi,
    I have a pie chart. I would like to have the slices in the pie chart clickable. When one slice is selected, I would like to display the detail information in another iGrid table. I have done it with iChart Bar with no problem. However, it seems like the pie chart doesn't response to any selection on the slices, except the legend tags for the whole chart.
    Did I miss some configuration?
    Thank you for your advice!

    Hi Yue,
    Instead of trying to click on the Chart, try clicking on the legend. It will work. It is working for me here.
    Use the same Selection Event and same Javascript. And click on the <b>Legend</b>. It will display the desired Value.
    For Example, i have used the below code for my SelectionEvent.
    <b>document.ChartName.getChartObject().getSelectedPen();</b>
    Hope this will help u.
    Regards
    Muzammil

  • Slow response LV7.0 and waveform charts

    I have noticed a couple of issues with a waveform chart (when actually plotting a waveform).
    1. Sometimes when I right-click on the chart to format a axes it may take up to 5 minutes to display the window with the chart format controls. During this time task manager says the application is not responding.
    2. When plotting anything with size (I am trying to plot 5 minutes of data at 512 samples/sec) the program slows to a crawl. If I plot a double data (take the Y data from the waveform) it works great. Why is there so much overhead with a waveform chart? Anyway to fix this?
    3. Unrelated to a waveform chart but related to item 1. Sometimes when I try to save my VI (~470 kb) it goes into limbo and may take minutes
    . Again the task manager says it is "not responding". This seems to be a theme with LV 7.0. Has anyone else run into this problem?

    > 1. Sometimes when I right-click on the chart to format a axes it may
    > take up to 5 minutes to display the window with the chart format
    > controls. During this time task manager says the application is not
    > responding.
    >
    > 2. When plotting anything with size (I am trying to plot 5 minutes of
    > data at 512 samples/sec) the program slows to a crawl. If I plot a
    > double data (take the Y data from the waveform) it works great. Why
    > is there so much overhead with a waveform chart? Anyway to fix this?
    >
    > 3. Unrelated to a waveform chart but related to item 1. Sometimes
    > when I try to save my VI (~470 kb) it goes into limbo and may take
    > minutes. Again the task manager says it is "not responding". This
    > seems to be a theme with LV 7.0. Has
    anyone else run into this
    > problem?
    Without looking at the waveform chart, it is hard to say. Things like
    autoscale will slow teh chart down a bit as it then needs to traverse
    more data looking for min/max. And when the scales do need to change a
    bit, all the data needs to be replotted, not just the new stuff.
    Other things that slow down a chart are to make its background
    transparent, and to make it overlapped. Finally, full screen updates on
    a big monitor mean lots of data needs to be moved around to draw lines
    and rectangles, and that either comes down to the CPU or video card.
    If you have more questions, or a VI to look at, post again.
    Greg McKaskle

  • Error while assigning Chart fo dep to Company code.

    Hi,
    I am getting an error "Inconsistency between FI company code PJP1 and chart of deprec. ZJCD" when i am trying to assign chart of depreciation to company code.
    The details description is below:
    Inconsistency between FI company code PJP1 and chart of deprec. ZJCD
    Message no. AC481
    Diagnosis
    You tried to assign chart of depreciation ZJCD to company code PJP1. According to its Customizing definition, this company code manages parallel currencies.
    The chart of depreciation does not contain a corresponding depreciation area for each of the currency types that are defined in the company code.
    System Response
    This assignment is not possible.
    Procedure
    1. Check the currency types of the company code.
    2. Specify a corresponding depreciation area for each currency type.
    Please let me know what should i do in this case.
    Regards,
    Dinesh Lakhotiya

    Hi Paul,
    It is already defined for my chart of depreciation.
    However, i think i am missing one step: Define depreciation areas for foriegn currencies.
    When i went into this step, i found that my company code is missing. No depreciation area currency is maintaine for my company code. There is no options of new entries also. If i want to maintain the same, how would i do that?
    Awaiting response.
    Regards,
    Dinesh Lakhotiya

  • How to populate data for SharePoint Team Foundation Server web part burndown, bug progress chart

    Hi,
    We are configuring the Team Foundation Server web part to show dashboards associated with burndown, user stories, etc. I added some active but when I click on the Bug Progress link, the chart does not display any data. I click on the Burndown link to
    add some issues data. When I click on the Task burndown or the  user story progress, I get the following message
    "The error occured during an attempt to establish a connection to the external data source. The following connections failed to refresh:
    TfsOlaReport"
    I would like the see the data correctly populated in the chart. Any help is greatly appreciated.

    Hi Comicrage86, 
    Thanks for your post.
    What’s the version of your TFS and SharePoint?
    Do you mean the burndown report and bug progress chart in team project site? If yes, your current team project created using which process template?
    As far as I know team project Release Burndown report shows in team project site by default. How did you add the active to show Bug Progress chart and did you custom your Burndown in team project site? Please share the detailed steps here. And you can share
    your screenshots here, it will help us provide the better response.
    If reports cannot show correctly in your team project site, please check the default reports in your team project>>Reports, ensure that default team project reports working fine in your Reporting Service site first. Then follow the
    steps in this
    article to troubleshooting the SharePoint Dashboards data source issue.
    Or refer to the solution in this post:
    https://social.msdn.microsoft.com/Forums/en-US/af054ca3-110b-4414-85d8-f36ea2416b0c/new-sharepoint-portal-excel-refresh-issues?forum=tfssetup.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I have a new ipad and everything works but can't connect to the app store. Itunes works and the wifi seems to be working but i get a blank white screen when i open the appstore.Nothing will load unter the features or charts tab. Any Suggestions?

    I have a new ipad and everything works but can't connect to the app store. Itunes works and the wifi seems to be working but i get a blank white screen when i open the appstore. Nothing will load unter the features or charts tab so i cant download any apps. Purchased and updates tab loads fine. Any suggestions?

    You would get better response from the iTunes community forum.
    Have a nice day!

  • In-skin RAS -- missing charts

    Hello,
    I have a number of reports which were originally developed in the Crystal Reports 8.x environment, which used the RDC API to manipulate charts at runtime. The execution environment was an MFC client application. I am trying to move these to a .NET 4.0 windows forms client application using Crystal Reports for Visual Studio 2010 SP1, and using in-skin RAS to perform the chart manipulation. The problem I am running into is that in-skin RAS cannot u201Cseeu201D all of the charts in the report templates. To allow customization of the charts, the original developers created separate footer sections (each containing a chart) for each of a large number of options, and used suppress formulas on the footer sections to decide which one of the 171 charts should be displayed. Granted, this made for long delays opening the report templates, but it did work.
    When I open one of these report templates in the designer, I can see that the charts have names of the form (Graph1-Graph171).
    However, at runtime, when I obtain the list of charts by calling u201CmyISCDRCD.ReportDefController.QueryChartObjects()u201D, I see chart objects for Graph1-118 correctly, but then the list starts over with u201CGraph1u201D again, repeating the first 63 or so charts, but never revealing the remaining charts that should be there.
    In an attempt to find a work-around, I have tried a number of alternative approaches for enumerating the charts. However, they all seem to end up with the same corrupted list.
    I also tried opening the charts by name (myISCDRCD.ReportDefController.ReportDefinition.FindObjectByName(u201CGraphxxxu201D)). In that case, any attempt to open a chart after u201CGraph118u201D just fails.
    Since only the chart that I am searching for is going to be visible, and it seems like the in-skin RAS is having issues with the large number of charts, I also tried working my way through the charts u2013 deleting invisible charts as I went. However a variety of approaches to this have yielded the same outcome (after deleting the first 118 graphs, getting a new list returns charts named u201CGraph1-Graph63u201D which in theory no longer exist in the report template).
    Is this a known issue? Is there any work-around?
    Thanks in advance

    Well, more than 120 or 160. Thanks for your response. It suggests another work-around. I will try merging all the charts into one section and then see if I can un-suppress just one chart and positon/size everything correctly at runtime...

  • Custom responsibility cannot read ar_system_parameters

    We are upgrading from EBS 11.5.10 to 12.1.3
    I am not able to run the seeded report ARXAGE (Aging - 4 Buckets Report) in R12 from a custom responsibility, though I am able to run it from the seeded Receivables Manager responsibility.
    The resaon being the Charts of Accounts parameter value is not defaulting. The default value is :
    select sb.chart_of_accounts_id   from gl_sets_of_books sb, ar_system_parameters sp  where sb.set_of_books_id = sp.set_of_books_id
    I am turing on the display property of the Charts of Accounts parameter. When I a logging onto Receivables Manager and attempting to run the program - the Charts of Accounts parameter is defaulting to 101. However when when I am trying to run the same report from the Custom Responsibility the Charts Of Accounts parameter is not populating with any default value. This is despite Examine/Profile$/ORG_ID is showing a value for the custom responsibility.
    When I am updating the parameter value to 101 - the process is still failing - because in the before report trigger there is a query on ar_system_parameters which is failing.
    I would like to know what needs to be done and why ar_systems_parameters could not be read from the custom responsibility (but can be read from Receivables Manager responsibility)
    I have compared the profile setup at responsibility level for both the Custom and Receivables Manager responsibility in R12.
    For custom responsibility - HR:User Type and MWA: Enable Personalization are defined.
    For Receivables Manager - AR: Dunning Letter Remit-To Address Label Size, AR: Mask Bank Account Numbers, AR: Use Statement, Dunning, and Late Charges Site Profiles, AR: Keep or Replace Existing Profile Amounts only.
    So I guess ORG_ID is defaulting from the Site Level for both. So what needs to be done to setup Application Context for the custom responsibility.
    Thanks

    Thanks for the update and for sharing the solution!
    Regards,
    Hussein

  • Is it possible to develop the control charts in WAD.

    Hi Gurus and Experts
    We need your suggestions to go futhure with our requirement.
    Right now KPI's are currently displayed in graphical form with the
    ability to drill down into WO's( Work orders) from the graph page. our
    new requirement is to get exactly the same set of information captured
    and presented in control chart form. This is to be an adjunct. to, not
    replace, the existing graphical set of data. Upper and lower control
    limits will be set initially by the business, and the same drill down
    functionality should be available from the control chart. The charts
    can be displayed seperately from the exisiting set of charts if this
    makes it easier.
    Can you please suggest us whether is it possible to develop the control
    charts and also have the functoinalities of the existing dashboards
    (example drill down of WO's using the control charts) in WAD or through
    viusal composer
    Waiting for your responses..
    Thanks
    Ravi...

    Hello dj_page!
    Thanks for the answer, but I know this already.
    My problem is, that the small picture in the side panel and the histogram in LR5 are bigger than in LR4.
    The two pictures are showing the difference between the versions.
    On the left hand (LR4) you can see a smaller preview and histogram than on the right hand (LR5).
    In each version you can change the size of the side panel only as small as the preview-window is.
    The pictures are also showing the smallest size of the side panel in each version.

  • How can I Migrate a Segmented Chart of Account with DTW?

    Hello.
    If anyone could help me to solve this problem I would be most gratefull...
    The templates installed in SAP Business One under the DTW folder do not include a segmented chart of account template, so I would like to know how can I transform (if that is possible) the standard model, or maybe find a way out, cause' the chart of account is pretty big and I have it all in a well defined CSV.
    Thank you.
    Luciano Silva - Lima-Perú

    Luciano,
    The forum that you have posted your question in is for questions related to the SAP Business One integration for SAP NetWeaver.  You should post this type of question in the SAP Business One SDK Forum or the SAP Business One Discussion Forum as you may get a quicker response.
    Eddy

  • Data web bean (chart) using a dynamic view object

    Please I want a quick help. I read all forums concerning this subject but I still couldn't do it.
    - I create a view object which takes a proameter using the ? style parameter.
    - I passed the parameter from an html page and execute the query
    of the view as follows:
    <%
    String deptno = request.getParameter("deptno");
    if(deptno != null) {
    oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "MyProject21_package3_Package3Module");
    oracle.jbo.ViewObject v = oracle.jbo.html.jsp.JSPApplicationRegistry.getInstance()
    .getAppModuleInstance("MyProject21_package3_Package3Module",request,session)
    .findViewObject("View1");
    v.setWhereClauseParam(0,deptno);
    v.executeQuery();
    %>
    - And then I used the data web bean chart as follows:
    <jsp:useBean class="oracle.jbo.html.databeans.ChartRenderer" id="ch" scope="request" >
    <%
    ch.setReleaseApplicationResources(false);
    ch.initialize(application,session, request,response,out,"MyProject21_package3_Package3Module.View1");
    ch.setCommonScriptName("/webapp/jsp/chart_common.jsp");
    ch.getChart().setGraphType(ch.PIE);
    ch.setSeriesLabelColumnName("DeptNo");
    ch.setDisplayAttributes("CountEmplNo");
    ch.getChart().setPieFeelerTextDisplay(0);
    ch.getChart().setPieTilt(10);
    ch.getChart().setPieRotate(0);
    ch.getChart().setLegendDisplay(true);
    ch.getChart().setLegendMarkerPosition(0);
    ch.getChart().setTitleString("Title");
    ch.getChart().setSubtitleString("Subtitle");
    ch.getChart().setFootnoteString("Footnote");
    ch.setImageWidth(400);
    ch.setImageHeight(400);
    ch.render();
    %>
    - I tried to use the View1 as a view name, and the v as a view name
    but both of them get the same result
    SQL Statement error and the sql statement is displayed with the ? in it which means that he didn't replace it by the parameter.
    Please I need quick help.
    Thanks.
    </jsp:useBean>
    Remark : please send me the reply at "[email protected]"

    Hi Rishab,
    I'm running into the exact same problem, in the same situation. Did you solve this problem and can you tell me how?
    Thanks in advance,
    Paskal

Maybe you are looking for

  • Binding between Task and method dissappears

    The binding between task and method is dissappearing . I tried creating a new task altogether but still not working kindly help Edited by: kittu reddy on May 6, 2008 3:19 PM

  • About project

    Hi , Any body pls explain about different steps present in a project development and supporting . And how we will submit our project to the client . I want detail description about real time environment Technical terms.

  • IE7 problem displaying page background correctly

    Has anyone noticed that when one uses a "Tinted Image Fill" for a page background, Internet Explorer 7 will move the left margin of the page background to the left such that the page does not display properly (this was not a problem in IE6). Other im

  • SRM-SUS Single client

    Hi All We have installed SRM 5.0. The SUS component is integrated with it. However we are not sure whether SRM and SUS components are communicating to each other ? Could any one confirm what all settings need to be done to activate SUS . If XI is req

  • How schedule line qty got changed?

    Hi, we observed there is a change in schedule line quantity. We have checked the change log in statistics but there is no record of change. We also checked in CDPOS for change record but there also there is no change record. As there is Firm zone mai