@@ -604,12 +604,11 @@ fn PlotBarsValuesGen(comptime T: type) type {
604
604
};
605
605
}
606
606
pub fn plotBarsValues (label_id : [:0 ]const u8 , comptime T : type , args : PlotBarsValuesGen (T )) void {
607
- assert (args .xv .len == args .yv .len );
608
- zguiPlot_PlotBars (
607
+ zguiPlot_PlotBarsValues (
609
608
label_id ,
610
609
gui .typeToDataTypeEnum (T ),
611
610
args .v .ptr ,
612
- @as (i32 , @intCast (args .xv .len )),
611
+ @as (i32 , @intCast (args .v .len )),
613
612
args .bar_size ,
614
613
args .shift ,
615
614
args .flags ,
@@ -655,6 +654,30 @@ pub fn dragPoint(id: i32, args: DragPoint) bool {
655
654
}
656
655
extern fn zguiPlot_DragPoint (id : i32 , x : * f64 , y : * f64 , * const [4 ]f32 , size : f32 , flags : DragToolFlags ) bool ;
657
656
//----------------------------------------------------------------------------------------------
657
+ pub const Tag = struct {
658
+ round : bool = false ,
659
+ };
660
+
661
+ pub fn tagX (x : f64 , col : [4 ]f32 , args : Tag ) void {
662
+ zguiPlot_TagX (x , & col , args .round );
663
+ }
664
+ extern fn zguiPlot_TagX (x : f64 , col : * const [4 ]f32 , round : bool ) void ;
665
+
666
+ pub fn tagXText (x : f64 , col : [4 ]f32 , comptime fmt : []const u8 , fmt_args : anytype ) void {
667
+ zguiPlot_TagXText (x , & col , "%s" , gui .formatZ (fmt , fmt_args ).ptr );
668
+ }
669
+ extern fn zguiPlot_TagXText (x : f64 , col : * const [4 ]f32 , fmt : [* :0 ]const u8 , ... ) void ;
670
+
671
+ pub fn tagY (y : f64 , col : [4 ]f32 , args : Tag ) void {
672
+ zguiPlot_TagY (y , & col , args .round );
673
+ }
674
+ extern fn zguiPlot_TagY (y : f64 , col : * const [4 ]f32 , round : bool ) void ;
675
+
676
+ pub fn tagYText (y : f64 , col : [4 ]f32 , comptime fmt : []const u8 , fmt_args : anytype ) void {
677
+ zguiPlot_TagYText (y , & col , "%s" , gui .formatZ (fmt , fmt_args ).ptr );
678
+ }
679
+ extern fn zguiPlot_TagYText (y : f64 , col : * const [4 ]f32 , fmt : [* :0 ]const u8 , ... ) void ;
680
+ //----------------------------------------------------------------------------------------------
658
681
// PlotText
659
682
const PlotTextFlags = packed struct (u32 ) {
660
683
vertical : bool = false ,
0 commit comments