Open salih-ozdemir opened 1 year ago
there is your good answer here. if change some line as
`public DynamicTimeSeriesChart(final String title) { dataset = new DynamicTimeSeriesCollection(1, 1000, new Second()); dataset.setTimeBase(new Second(0, 0, 0, 23, 1, 2014)); dataset.addSeries(new float[1], 0, title); chart = ChartFactory.createTimeSeriesChart( title, "Time", title, dataset, true, true, false); final XYPlot plot = chart.getXYPlot();
//XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
XYSplineRenderer renderer = new XYSplineRenderer(15);
plot.setRenderer(renderer);
plot.setOrientation(PlotOrientation.HORIZONTAL);
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setFixedAutoRange(10000);
axis.setDateFormatOverride(new SimpleDateFormat("ss.SS"));
final ChartPanel chartPanel = new ChartPanel(chart);
add(chartPanel);
}`
not show line of graph. also shown vertex point. XYLineAndShapeRenderer working but XYSplineRenderer some bugs. this error repeated other render like XYBezierRenderer .
I had no trouble with horizontal orientation in this example that uses XYLineAndShapeRenderer
.
With XYSplineRenderer
, which uses natural cubic splines, I see problems if the data are duplicated vertically, as happens with this example in the horizontal orientation. If I understand correctly, this is a limitation of splines.
On horizontal orientation, Firstly There is no problem with XYLineAndShapeRenderer, but XYSplineRenderer not draw graph. actually there is a drawing there but graph line meaninglessly hidden. when start graph only one part of line, but second process hidding line.
XYSplineRenderer has no problem on Vertical orientation. The problem start with horizontal orientation.