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

Bar Trace Config Not Applying/First Bar is Never Drawn #3

Open
Jeffus66 opened this issue Jun 15, 2018 · 1 comment
Open

Bar Trace Config Not Applying/First Bar is Never Drawn #3

Jeffus66 opened this issue Jun 15, 2018 · 1 comment

Comments

@Jeffus66
Copy link

I am attempting to use the barTrace in my project and no matter what I try, the first bar never gets drawn on the screen. The screenshot examples seem to have this issue as well. The first bar is not drawn on the examples either. All other bars are drawn fine. I also noticed when debugging, the configuration is not getting saved to the barTrace either. Still getting orange bars when color is set to purple. Below is the code I am using. Viewing the trace in plotly on the web displays the bar chart perfectly.

    JavaFxDataViewer dataviewer = new JavaFxDataViewer();

    DataViewerConfiguration config = new DataViewerConfiguration();

    BarTrace<Object> barTrace = new BarTrace<>();

    TraceConfiguration barConfig = new TraceConfiguration();

    PlotData plotData = new PlotData();

    String xAxis[] = {" "," "," "," "," "," "," "," "," "," "};
    Integer yAxis[] = {1,1,1,1,1,1,1,1,1,1};

    for(String s: topTen.keySet()){
        xAxis[i] = s;
        i++;
    }

    for(int p: topTen.values()){
        yAxis[j] = p;
        j++;
    }

    barTrace.setxArray(xAxis);
    barTrace.setyArray(yAxis);
    barTrace.setTraceColour(TraceColour.PURPLE);
    barTrace.setConfiguration(barConfig);

    config.setPlotTitle("Top 10 Words Used");
    config.setxAxisTitle("Word");
    config.setyAxisTitle("Times Used");
    config.showLegend(true);
    config.setLegendInsidePlot(false);

    dataviewer.updateConfiguration(config);

    plotData.addTrace(barTrace);

    dataviewer.updatePlot(plotData);
@jasrodis
Copy link
Owner

Thanx @Jeffus66 for letting me know.
I will try to have a look at the issue asap.

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