List of usage examples for javafx.scene.chart PieChart setLegendVisible
public final void setLegendVisible(boolean value)
From source file:de.ifsr.adam.ImageGenerator.java
/** * Generates a pie chart.//from www . j a va 2 s .com * * @param question A question JSONObject of a report * @return */ private PieChart generatePieChart(JSONObject question) { ObservableList<PieChart.Data> data; PieChart chart; JSONObject surveyQuestion; JSONObject answerType; JSONObject result; try { surveyQuestion = getSurveyQuestion(question.getString("question")); try { answerType = getAnswerType(surveyQuestion.getString("type")); } catch (NullPointerException e) { log.error("The answerType of " + question + " wasnt generated due to a NullPointer"); log.debug("", e); return null; } result = question.getJSONObject("result"); data = generateDataPieChart(result, answerType); chart = new PieChart(data); chart.setTitle(surveyQuestion.getString("text")); chart.setLegendVisible(false); } catch (JSONException e) { log.error(e); return null; } return chart; }