BarVisualAttributes¶
Inherits: VisualAttributes
Namespace: TauPlot
Data-oriented per-sample style overrides for BAR overlays.
Description¶
BarVisualAttributes is the BAR specific subclass of VisualAttributes. It carries the two buffers inherited from that base class, color_buffer and alpha_buffer, and adds no overlay-specific buffers of its own.
Assign an instance to TauXYSeriesBinding.visual_attributes when the binding targets a BAR overlay. The renderer reads the buffers during each draw pass and applies per-sample overrides on top of the values resolved from TauBarStyle and TauXYStyle.
Each buffer is optional. A null buffer means no per-sample override for that property, and the resolved style value applies to every sample in the series. Partial buffers are supported: for any sample index past the end of the buffer, the resolved style value applies.
Example¶
# Color each bar individually by building a per-sample ColorBuffer.
var series_capacity := dataset.get_series_capacity(series_id)
var colors := TauPlot.ColorBuffer.new(series_capacity)
for i in series_capacity:
colors.append_value(Color(0.2 + i * 0.1, 0.4, 0.8))
var attributes := TauPlot.BarVisualAttributes.new()
attributes.color_buffer = colors
var binding := TauXYSeriesBinding.new()
binding.pane_index = 0
binding.series_id = series_id
binding.overlay_type = TauXYSeriesBinding.PaneOverlayType.BAR
binding.y_axis_id = TauPlot.AxisId.LEFT
binding.visual_attributes = attributes
Constructor¶
new()¶
Creates a new BarVisualAttributes instance with all buffers set to null.
Related Classes¶
VisualAttributesBase class. Defines the inheritedcolor_bufferandalpha_buffer.TauXYSeriesBindingOwns the instance via itsvisual_attributesproperty.BarVisualCallbacksCompanion class that computes the same properties from a callback rather than a buffer.TauBarStyleProvides the resolved bar style values that buffers override.ScatterVisualAttributesSibling subclass forSCATTERoverlays.ColorBufferRing buffer storingColorvalues, used bycolor_buffer.Float32BufferRing buffer storingfloatvalues (32-bit), used byalpha_buffer.