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

XYSeries.getXYSeriesRenderStyle() is null even after variable Assignment #849

Open
yanlzhl opened this issue May 7, 2024 · 1 comment
Open

Comments

@yanlzhl
Copy link

yanlzhl commented May 7, 2024

private void testRenderStyle(XYSeriesRenderStyle renderStyle) {
    // Create Chart
    XYChart chart = new XYChartBuilder().build();

    // Set default series render style
    chart.getStyler().setDefaultSeriesRenderStyle(renderStyle);

    // Add series
    XYSeries series = chart.addSeries("series1", new double[] {1, 2, 3}, new double[] {1, 2, 3});

    // Verify the series render style
    assertNotEquals(renderStyle, series.getXYSeriesRenderStyle());
  }

image

@timmolter
Copy link
Member

please post a fully working isolated code example. You could use this as a start:

public class TestForIssue849 {

  public static void main(String[] args) throws ParseException {

    XYChart chart = getXYChart();
    new SwingWrapper(chart).displayChart();
  }

  public static XYChart getXYChart() {
    XYChart chart =
        new XYChartBuilder()
            .width(720)
            .height(480)
            .title("getXYSeriesRenderStyle Example")
            .xAxisTitle("Count")
            .yAxisTitle("Value")
            .build();


    double[] xValues = new double[] {1, 2, 3};
    double[] yValues = new double[] {1, 2, 3};
    chart.addSeries("main", xValues, yValues);

    return chart;
  }
}

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