Skip to main content
v2.2

3D Axis

In Chart3D, axis defines a numeric range on a single plane (X, Y or Z), that will be used to scale attached Series to the Chart3Ds viewport.

Accessing Default Axes

Take references to the built-in axes for interval or styling changes.

x_axis = chart.get_default_x_axis()
y_axis = chart.get_default_y_axis()
z_axis = chart.get_default_z_axis()

# Example: lock the Y axis interval
y_axis.set_interval_restrictions(start_min=0, end_max=100)

Accessing Axes from a Series

When you already have a series, you can read the axes it is attached to:

series = chart.add_line_series()
x_axis = series.axis_x
y_axis = series.axis_y
z_axis = series.axis_z

# Example: lock Y on the series' axis
series.axis_y.set_interval_restrictions(start_min=0, end_max=100)

Title & Appearance

Customize the appearance and style of the Axis title.

# Set axis title
axis.set_title("Time (ms)")

# Set title color
axis.set_title_color('red')

# Set font for title
axis.set_title_font(
size=16,
family='Arial, Helvetica, sans-serif',
style='italic',
weight='bold'
)

# Set rotation
axis.set_title_rotation(90)

# Enable/Disable title effect
axis.set_title_effect(True)

Axis Visibility

# Show or hide the axis
axis.set_visible(True)

Axis Stroke & Thickness

# Set stroke thickness and color
axis.set_stroke(thickness=2, color='black')

Custom Tick

After creating a custom tick, it can be used to completely control tick placement, text, and styles in a 3D environment.

# Create a custom tick (major, minor, or box)
custom = axis.add_custom_tick("major")

# Position it on the axis (in data units)
custom.set_value(2.5)

# Override its label
custom.set_text("Quarter Point")

# Style the label background
custom.set_background_color("#FFFFE0") # hex, color name, or Color object
custom.set_background_stroke(thickness=1, color="gray")

# Draw its grid line under the surface
custom.set_grid_stroke(thickness=0.5, color="#CCCCCC")

# Style the text itself
custom.set_text_color("#333333")
custom.set_text_font(
size=12,
family="Arial, Helvetica, sans-serif",
style="normal",
weight="bold"
)

# Adjust the tick line
custom.set_tick_length(6) # length in pixels
custom.set_tick_style(thickness=1, color="black")

# Tweak padding around the label
custom.set_padding(4)
custom.set_padding(left=2, top=4, right=2, bottom=4)

Tick Labels

Control tick label styling and formatting, including font, color, rotation, scaling, units, rounding, and numeric formats (percentage, currency, scientific, etc.).

# Basic visual styling (font, color, rotation)
x_axis.set_tick_labels(
major_size=12,
family="Arial",
style="normal",
weight="bold",
major_rotation=45,
major_color=(255, 0, 0, 255),
)

# Numeric formatting example:
# - scale raw values by 0.001
# - round to 2 decimals
# - show as kHz
x_axis.set_tick_labels(
format_type="standard",
operation="round",
precision=2,
unit="kHz",
scale=0.001,
)

Axis Intervals

Axis intervals can be configured by axis.set_interval()

import lightningchart as lc

lc.set_license('my-license-key')

chart = lc.Chart3D()
x_axis = chart.get_default_x_axis()
y_axis = chart.get_default_y_axis()

x_axis.set_interval(start=0, end=1000)
y_axis.set_interval(start=-250, end=500)

Default Interval

Custom default axis interval can be set by axis.set_default_interval()

import lightningchart as lc

lc.set_license('my-license-key')

chart = lc.Chart3D()
x_axis = chart.get_default_x_axis()

x_axis.set_default_interval(start=-100, end=100)

Interval Restrictions

Various axis interval restrictions can be applied by axis.set_interval_restrictions()

import lightningchart as lc

lc.set_license('my-license-key')

chart = lc.Chart3D()

x_axis = chart.get_default_x_axis()
x_axis.set_interval_restrictions(
interval_min=10,
interval_max=100,
start_min=-25,
start_max=25,
end_min=25,
end_max=50
)

Scrolling Axis

One of the most important features of LightningChart Python is smooth real-time visualization, i.e., visualization of a data set that is continuously receiving new data points.

In real-time monitoring use cases, there is often a scrolling axis (often Time axis) whose interval is progressively moving forward along with the incoming data. To achieve this, a scrolling strategy is used as default:

axis.set_scroll_strategy(
strategy='scrolling',
progressive=True,
realtime=True,
start=True,
end=True,
visibleonly=False
)

The scrolling strategy does not change size of axis interval, but shifts the interval forward when new data comes in.

To use it, the set_interval() method is used in conjunction to configure the axis interval (important: remember to use stop_axis_after flag to prevent stopping the axis).

Date-Time Axis

Display seconds, minutes, hours, days, months and years using automatically placed axis ticks.

axis.set_tick_strategy('DateTime')

For more information please see Time series data section.