Rizwan Posted June 26, 2009 Report Share Posted June 26, 2009 Hi, I have two differnt charts, one bar and a pie chart. Basically want to use Mutlipane charts concept (both charts in one pane). I checked Pane and PaneCollection class for this. I have "add" etc for this. But basically couldnt get how to get 2 chart objects and put in a single pane. I couldn't find any example. Can I get a sample fcode or this. Thanks, Rizwan Quote Link to comment Share on other sites More sharing options...
juanZ Posted June 26, 2009 Report Share Posted June 26, 2009 Hi, The following code snippet will show you how to create and set 2 panes into a Chart FX 6.5 for Java. The pane separation will not create 2 different charts. It will split series into different panes inside the chart. Yo can assign different Y Axis to those panes. The complete version of this sample including data and styles is part of the Chart FX 6.5 for Java Samples. This samples are in the installation folder of Chart FX. chart1.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE); SeriesAttributes series0 = chart1.getSeries().getItem(1);series0.setGallery(Gallery.LINES); series0.setLineWidth((short) 2);series0.setMarkerShape(MarkerShape.NONE); series0.setYAxis(YAxis.MAIN);SeriesAttributes series1 = chart1.getSeries().getItem(0);series1.setGallery(Gallery.AREA); series1.setBorder(true);series1.setYAxis(YAxis.SECONDARY);Axis axis = chart1.getAxis().getItem(YAxis.MAIN);axis.setStyle(axis.getStyle()|AxisStyle.INTERLACED);axis.setForceZero(false);axis.getLabelsFormat().setFormat(AxisFormat.CURRENCY);axis = chart1.getAxis().getItem(YAxis.SECONDARY);axis.setScaleUnit(1000000);axis.getLabelsFormat().setDecimals(0);chart1.recalcScale();chart1.getAxisY().setPane(0);chart1.getAxisY2().setPane(1);chart1.getAxisY2().setPosition(AxisPosition.NEAR);Pane pane1 = chart1.getPanes().getItem(0);pane1.setProportion(15);pane1.getTitle().setText("Price");Pane pane2 = chart1.getPanes().getItem(1);pane2.setProportion(8);pane2.getTitle().setText("Volume (in Millions)"); Hope this helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.