Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Compress/Expand data visualization

    Hi all,

    having a XY chart I would like compress/expand data visualization both for X and Y axis by left mouse click, keep pressed and drag

    Here is a chart example

    Compress/Expand data visualization-a01973.png

    and here is the code to plot sample data

    Java FX Code:
    public class BaseXYChart extends Application {
    
        @Override
        public void start(Stage stage) {
           stage.setTitle("Linear plot");
            
           final CategoryAxis xAxis = new CategoryAxis();
           final NumberAxis yAxis = new NumberAxis(1, 22, 0.5);
            
           yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis){
                @Override
            public String toString(Number object){
                return String.format("%7.2f", object);
            }
        });
    final LineChart<String, Number>lineChart = new LineChart<String, Number>(xAxis, yAxis);
    
           lineChart.setCreateSymbols(false);
           lineChart.setAlternativeRowFillVisible(false);
           lineChart.setLegendVisible(false);
                   
           XYChart.Series series1 = new XYChart.Series();
            
            series1.getData().add(new XYChart.Data("Jan", 1));
            series1.getData().add(new XYChart.Data("Feb", 1.5));
            series1.getData().add(new XYChart.Data("Mar", 2));
            series1.getData().add(new XYChart.Data("Apr", 2.5));
            series1.getData().add(new XYChart.Data("May", 3));
            series1.getData().add(new XYChart.Data("Jun", 4));
            series1.getData().add(new XYChart.Data("Jul", 6));
            series1.getData().add(new XYChart.Data("Aug", 9));
            series1.getData().add(new XYChart.Data("Sep", 12));
            series1.getData().add(new XYChart.Data("Oct", 15));
            series1.getData().add(new XYChart.Data("Nov", 20));
            series1.getData().add(new XYChart.Data("Dec", 22));
     
            BorderPane pane = new BorderPane();
            pane.setCenter(lineChart);          
            Scene scene = new Scene(pane, 800, 600);
            lineChart.getData().addAll(series1);
             
            stage.setScene(scene);
            stage.show();
        }
    
        public static void main(String[] args) {
            launch(args);
        }   
    }
    How can I accomplish this? Haven't found any examples anywhere!

    Thanks.

    Susie

  2. #2
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Re: Compress/Expand data visualization

    This is the expected result after left mouse click, keep pressed and dragged from top to bottom on Y Axis

    Compress/Expand data visualization-a01995.png

    The same is expected for X Axis, by dragging lef/right data should compress or expand.

    Susie
    Last edited by susieferrari; 07-19-2012 at 09:17 AM.

  3. #3
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Re: Compress/Expand data visualization

    This question also is now closed, solved right now.

    Thanks

    Susie

  4. #4
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

    Default Re: Compress/Expand data visualization

    ^That's great. If you think that your code could be helpful to others please post your code here.

  5. #5
    Join Date
    Mar 2011
    Location
    Parma Italy
    Posts
    88
    Rep Power
    0

    Default Re: Compress/Expand data visualization

    Hi cselic,

    looking at how many help I've got (you and DarrylBurke were the only one who try to help me) it seems none is interested: no replies, no suggestions, nothing at all.

    Now I am working at fine tuning the code to fix some minor problems, so it takes me some more time before it is full working, and after that I will share if other would be interested in.

    Thanks

    Susie

Similar Threads

  1. How to expand the JPanels dynamically?...
    By Vin in forum New To Java
    Replies: 6
    Last Post: 01-27-2010, 12:58 PM
  2. shrink and expand nemu when user click
    By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-06-2009, 07:02 AM
  3. SwT Expand items problem in Solaris.
    By Sureshgurram in forum SWT / JFace
    Replies: 0
    Last Post: 01-27-2009, 10:23 AM
  4. Data Visualization
    By jafaryj in forum New To Java
    Replies: 0
    Last Post: 11-28-2007, 06:16 PM
  5. UML Visualization (DNX file)
    By Marcus in forum XML
    Replies: 1
    Last Post: 07-06-2007, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •