Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XYSplineRenderer Horizantal Orientation Problem #357

Open
salih-ozdemir opened this issue Apr 18, 2023 · 3 comments
Open

XYSplineRenderer Horizantal Orientation Problem #357

salih-ozdemir opened this issue Apr 18, 2023 · 3 comments

Comments

@salih-ozdemir
Copy link

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.

@trashgod
Copy link
Contributor

It's not clear where your code is going awry, but two approaches are examined here: one illustrates using the existing renderer; the other illustrates a custom renderer.

@salih-ozdemir
Copy link
Author

salih-ozdemir commented Apr 24, 2023

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 .

@trashgod
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants