Package qupath.lib.gui.charts
Class Charts.PieChartBuilder
java.lang.Object
qupath.lib.gui.charts.Charts.PieChartBuilder
- Enclosing class:
- Charts
Builder for creating pie charts.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected doubleprotected ImageData<?> protected Sideprotected booleanprotected doubleprotected Stringprotected QuPathViewerprotected double
- 
Method SummaryModifier and TypeMethodDescriptionAdd a slice to the pie.build()Build a chart according to the specified parameters.convertToPercentages(boolean doConvert) Request that pie chart values are converted to percentages for tooltips.protected PieChartSpecify data for the pie chart as a map.protected StringGet a window title to use for charts of this kind, assuming the user has not specified one.protected Charts.PieChartBuildergetThis()height(double height) Set the preferred height of the chart.Specify anImageDataobject.legend(boolean show) Specify whether the legend should be shown or not.Specify the side of the chart where the legend should be shown.Specify the side of the chart where the legend should be shown.markerOpacity(double opacity) Specify the marker opacity.Set the parent window.show()Add the chart to a stage, and show it in the Application thread.size(double width, double height) Set the preferred size of the chart.Specify the chart title.tooltips(boolean showTooltips) Request tooltips to be shown when the cursor hovers over the pie chart.toStage()Add the chart to a stage, but do not show it.protected voidupdateChart(PieChart chart) Method that applies properties of this builder to the chart.viewer(QuPathViewer viewer) Specify a viewer.width(double width) Set the preferred width of the chart.windowTitle(String title) Title to use for the window, if the chart is shown.
- 
Field Details- 
viewer
- 
imageData
- 
title
- 
legendVisibleprotected boolean legendVisible
- 
legendSide
- 
markerOpacityprotected double markerOpacity
- 
widthprotected double width
- 
heightprotected double height
 
- 
- 
Method Details- 
getThis
- 
createNewChart
- 
getDefaultWindowTitleGet a window title to use for charts of this kind, assuming the user has not specified one.- Returns:
- a suitable title to use
 
- 
dataSpecify data for the pie chart as a map. Keys refer to categories, and values are numeric determining the size of the corresponding slice.- Parameters:
- data- the data map to show
- Returns:
- this builder
 
- 
convertToPercentagesRequest that pie chart values are converted to percentages for tooltips.- Parameters:
- doConvert-
- Returns:
 
- 
tooltipsRequest tooltips to be shown when the cursor hovers over the pie chart.- Parameters:
- showTooltips-
- Returns:
 
- 
addSliceAdd a slice to the pie.- Parameters:
- name- object the slice represents
- value- number that determines the proportion of the pie for the given slice
- Returns:
- this builder
 
- 
updateChartMethod that applies properties of this builder to the chart. Each subclass should call the method in the parent class to ensure its properties have been applied.- Parameters:
- chart-
 
- 
titleSpecify the chart title.- Parameters:
- title- the title to display
- Returns:
- this builder
 
- 
legendSpecify whether the legend should be shown or not.- Parameters:
- show- if true, show the legend; otherwise hide the legend
- Returns:
- this builder
 
- 
legendSpecify the side of the chart where the legend should be shown. Valid values are"top", "bottom", "left", "right".Any other value (including null) will result in the legend being hidden. - Parameters:
- side- the side where the legend should be shown
- Returns:
- this builder
 
- 
legendSpecify the side of the chart where the legend should be shown. If null, the legend will be hidden.- Parameters:
- side- the side where the legend should be shown
- Returns:
- this builder
 
- 
markerOpacitySpecify the marker opacity.- Parameters:
- opacity- value between 0 (transparent) and 1 (opaque).
- Returns:
- this builder
 
- 
imageDataSpecify anImageDataobject. This can be used to make some charts 'live', e.g. if they relate to objects within the hierarchy of this data.- Parameters:
- imageData- the imageData to associated with this chart
- Returns:
- this builder
 
- 
viewerSpecify a viewer. This can be used to make some charts 'live', e.g. if they relate to objects within the viewer.- Parameters:
- viewer- the viewer to associated with this chart
- Returns:
- this builder
 
- 
widthSet the preferred width of the chart.- Parameters:
- width- preferred width
- Returns:
- this builder
 
- 
heightSet the preferred height of the chart.- Parameters:
- height- preferred height
- Returns:
- this builder
 
- 
sizeSet the preferred size of the chart.- Parameters:
- width- preferred width
- height- preferred height
- Returns:
- this builder
 
- 
parentSet the parent window. If not set, QuPath will try to choose a sensible default. This is useful to avoid the chart falling 'behind' other windows when not in focus.This is relevant only if show()ortoStage()will be called.- Parameters:
- parent- the requested parent window
- Returns:
- this builder
 
- 
windowTitleTitle to use for the window, if the chart is shown.This is relevant only if show()ortoStage()will be called.- Parameters:
- title- window title
- Returns:
- this builder
 
- 
buildBuild a chart according to the specified parameters.- Returns:
- the chart
 
- 
toStageAdd the chart to a stage, but do not show it.- Returns:
- the stage containing this Chart.
- See Also:
 
- 
showAdd the chart to a stage, and show it in the Application thread.- Returns:
- the stage containing this Chart.
- See Also:
 
 
-