Results 1 to 5 of 5
- 07-16-2012, 12:28 PM #1
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

and here is the code to plot sample data
How can I accomplish this? Haven't found any examples anywhere!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); } }
Thanks.
Susie
- 07-19-2012, 09:15 AM #2
- 07-23-2012, 10:21 AM #3
Re: Compress/Expand data visualization
This question also is now closed, solved right now.
Thanks
Susie
- 07-23-2012, 10:41 AM #4
Senior Member
- Join Date
- Apr 2010
- Location
- Belgrade, Serbia
- Posts
- 278
- Rep Power
- 4
Re: Compress/Expand data visualization
^That's great. If you think that your code could be helpful to others please post your code here.
- 07-23-2012, 10:55 AM #5
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
-
How to expand the JPanels dynamically?...
By Vin in forum New To JavaReplies: 6Last Post: 01-27-2010, 12:58 PM -
shrink and expand nemu when user click
By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 03-06-2009, 07:02 AM -
SwT Expand items problem in Solaris.
By Sureshgurram in forum SWT / JFaceReplies: 0Last Post: 01-27-2009, 10:23 AM -
Data Visualization
By jafaryj in forum New To JavaReplies: 0Last Post: 11-28-2007, 06:16 PM -
UML Visualization (DNX file)
By Marcus in forum XMLReplies: 1Last Post: 07-06-2007, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks