Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/plot.zig
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ pub fn setupAxis(axis: Axis, args: SetupAxis) void {
zguiPlot_SetupAxis(axis, if (args.label) |l| l else null, args.flags);
}
extern fn zguiPlot_SetupAxis(axis: Axis, label: ?[*:0]const u8, flags: AxisFlags) void;
Copy link

Copilot AI Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setAxis function lacks documentation. Consider adding a doc comment explaining its purpose, when to use it, and how it affects subsequent plotting operations.

Suggested change
extern fn zguiPlot_SetupAxis(axis: Axis, label: ?[*:0]const u8, flags: AxisFlags) void;
extern fn zguiPlot_SetupAxis(axis: Axis, label: ?[*:0]const u8, flags: AxisFlags) void;
/// Sets the current axis for subsequent plotting operations.
///
/// Call this function to change the active axis (e.g., x1, y2) before issuing plot commands.
/// This affects which axis subsequent plot items will be associated with.
/// Use this when you want to plot data to a specific axis after multiple axes have been set up.

Copilot uses AI. Check for mistakes.
pub fn setAxis(axis: Axis) void {
zguiPlot_SetAxis(axis);
}
extern fn zguiPlot_SetAxis(axis: Axis) void;
//----------------------------------------------------------------------------------------------
pub const Condition = enum(u32) {
none = @intFromEnum(gui.Condition.none),
Expand Down
5 changes: 5 additions & 0 deletions src/zplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ extern "C"
ImPlot::SetupFinish();
}

ZGUI_API void zguiPlot_SetAxis(ImAxis axis)
{
ImPlot::SetAxis(axis);
}

ZGUI_API bool zguiPlot_BeginPlot(const char *title_id, float width, float height, ImPlotFlags flags)
{
return ImPlot::BeginPlot(title_id, {width, height}, flags);
Expand Down
Loading