I am creating a graph with contain x
and y
value. The y axis
in normal but x
is with the logarithmic value. I used the library (jfreechart.jar
) for making this logarithmic graph.
My question is how can in fine the exact value of x
if for example y is 10
? (the value of x is in logarithmic number)
private void interActionPerformed(java.awt.event.ActionEvent evt) {
final XYSeries s1 = new XYSeries("Series 1");
s1.add(0.075,4.8);
s1.add(0.15,13.9);
s1.add(0.425,19.5);
s1.add(0.6,22.1);
s1.add(1.18,26.6);
s1.add(2,29.5);
s1.add(2.36,31.2);
s1.add(4.75,38.6);
s1.add(9.5,46.2);
s1.add(19,62.4);
s1.add(25,76.);
s1.add(37.5,86.2);
s1.add(50,100);
final XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(s1);
final JFreeChart chart = ChartFactory.createXYLineChart(
"sieve analyese", // chart title
"sieve size", // domain axis label
"passing", // range axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true,
false
);
final XYPlot plot = chart.getXYPlot();
final LogarithmicAxis domainAxis = new LogarithmicAxis("particle size in milimeters");
final NumberAxis rangeAxis = new NumberAxis("percent passing");
plot.setDomainAxis(domainAxis);
plot.setRangeAxis(rangeAxis);
BarRenderer renderer = null;
ChartFrame frame = new ChartFrame("sive chart", chart);
frame.setVisible(true);
frame.setSize(1000,600);
chart.setBackgroundPaint(Color.lightGray);
plot.setOutlinePaint(Color.RED);
} [chart of x and y value][1]