javafx-dataviewer-wrapper icon indicating copy to clipboard operation
javafx-dataviewer-wrapper copied to clipboard

Bar Trace Config Not Applying/First Bar is Never Drawn

Open Jeffus66 opened this issue 7 years ago • 1 comments

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);

Jeffus66 avatar Jun 15 '18 16:06 Jeffus66

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

jasrodis avatar Jun 16 '18 10:06 jasrodis