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

Annotations #856

Open
MazZRud opened this issue May 30, 2024 · 0 comments
Open

Annotations #856

MazZRud opened this issue May 30, 2024 · 0 comments

Comments

@MazZRud
Copy link

MazZRud commented May 30, 2024

Hy I tried to use setHasAnnotations but have an error..
This is my code

    // Create Chart
    CategoryChart chart = new CategoryChartBuilder().width(800).height(600).title("Score Histogram").xAxisTitle("Score").yAxisTitle("Number").build();
 
    // Customize Chart
    chart.getStyler().setLegendPosition(LegendPosition.OutsideE);
    chart.getStyler().setLegendVisible(false);
    
    //Setta il titolo "vuoto" e anche delle serie
    chart.setTitle("");
    chart.setXAxisTitle("");
    chart.setYAxisTitle("");
    
    //Set background color area esterna al grafico
    Color b = new Color(235,235,235);
    chart.getStyler().setChartBackgroundColor(b);
    //Set background color area interna al grafico
    chart.getStyler().setPlotBackgroundColor(b);
    
    //Setta la doppia riga dei dati ad invisible
    chart.getStyler().setAxisTicksLineVisible(false);
    //Setta visible o meno i dati di riferimenento delle serie
    //chart.getStyler().setAxisTicksVisible(false);
    
    //Setta visible il bordo esterno del grafico
    chart.getStyler().setPlotBorderVisible(false);
    
    //Setta invisible le righette interne al grafico
    chart.getStyler().setPlotGridLinesVisible(false);
    
    Color[] c = new Color[] {new Color(82,148,165)};
    chart.getStyler().setSeriesColors(c);
    
    //Setta il colore del testo delle scritte in x e y
    Color t = new Color(64,65,66);
    chart.getStyler().setAxisTickLabelsColor(t);
    //Setta il font del testo delle scritte in x e y
    chart.getStyler().setAxisTickLabelsFont(new Font("Segoe Ui", 0, 11));
    
    
    chart.getStyler().setHasAnnotations(true);
    // Series
    chart.addSeries("test 1", Arrays.asList(new String[] { "Rep1", "Rep2", "Rep3", "Rep4", "Rep5" }), Arrays.asList(new Integer[] { 4, 5, 9, 6, 5 }));

This line chart.getStyler().setHasAnnotations(true); gives me the error "The method setHasAnnotations(boolean) is undefined for the type CategoryStyler" and suggests me to CAST to chart.getStyler()
Any idea ?

Thks

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

1 participant