Package core
Class Visualizer
java.lang.Object
core.Visualizer
Handles visualization of spectrometer data.
Supports bar and curve plots with optional error bars and normalization.
Can display data on wavelength or frequency axes.
- Version:
- 1.0
- Author:
- Spectrometer Control Software
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of axis types for the x-axis.static enumEnumeration of plot types. -
Constructor Summary
ConstructorsConstructorDescriptionVisualizer(MeasurementSet measurementSet) Constructs a Visualizer for the given measurement set. -
Method Summary
Modifier and TypeMethodDescriptionorg.knowm.xchart.XYChartcreateAbsorptionChart(MeasurementSet reference, MeasurementSet sample) Create absorption chart comparing reference and sample.org.knowm.xchart.CategoryChartCreate bar chart for current measurement set.org.knowm.xchart.XYChartCreate curve chart for current measurement set.voidsetAxisType(Visualizer.AxisType axisType) Sets the axis type.voidsetNormalize(boolean normalize) Sets whether to normalize data to maximum value.voidsetPlotType(Visualizer.PlotType plotType) Sets the plot type.voidsetPlotType(String plotType) Sets the plot type from a string.voidsetShowErrorBars(boolean showErrorBars) Sets whether to show error bars.voiduseWavelengthAxis(boolean useWavelength) Convenience method to set wavelength/frequency axis.
-
Constructor Details
-
Visualizer
Constructs a Visualizer for the given measurement set.- Parameters:
measurementSet- the data to visualize
-
-
Method Details
-
setPlotType
Sets the plot type.- Parameters:
plotType- the PlotType enum value
-
setPlotType
Sets the plot type from a string.- Parameters:
plotType- "bar" for bar chart, anything else for curve
-
setNormalize
public void setNormalize(boolean normalize) Sets whether to normalize data to maximum value.- Parameters:
normalize- true to normalize, false otherwise
-
setShowErrorBars
public void setShowErrorBars(boolean showErrorBars) Sets whether to show error bars.- Parameters:
showErrorBars- true to show error bars, false otherwise
-
setAxisType
Sets the axis type.- Parameters:
axisType- the AxisType enum value
-
useWavelengthAxis
public void useWavelengthAxis(boolean useWavelength) Convenience method to set wavelength/frequency axis.- Parameters:
useWavelength- true for wavelength axis, false for frequency
-
createBarChart
public org.knowm.xchart.CategoryChart createBarChart()Create bar chart for current measurement set.- Returns:
- CategoryChart configured with the measurement data
-
createCurveChart
public org.knowm.xchart.XYChart createCurveChart()Create curve chart for current measurement set.- Returns:
- XYChart configured with the measurement data
-
createAbsorptionChart
public org.knowm.xchart.XYChart createAbsorptionChart(MeasurementSet reference, MeasurementSet sample) Create absorption chart comparing reference and sample. Absorbance A = -log₁₀(I/I₀).- Parameters:
reference- the reference measurement set (I₀)sample- the sample measurement set (I)- Returns:
- XYChart showing absorption spectrum
-