895 views
in GUI Development by

Hi Team,

I am trying to draw graph for binary data and I want to draw it in block style (square wave type) as give n below:

 

But With embedded wizard provided Graph(Path) I could draw as below:

 

The graph is not making straight vertical path as we expect in square wave like graphs instead it is connecting next sample.

Please let me know how could I utilise the Embedded Wizard Graph to draw required one 

1 Answer

+1 vote
by
 
Best answer

Hello Vikas,

this is not a limitation of the Path Data functionality. In order to have straight vertical lines you have to provide correct coordinates for the start and end position of the respective line segments. Use the method AddLine() to add a single line segment to the path. For example, the following code creates a path with rectangle shape:

// Here I assume the path will store up to 10 line segments.
Path.InitSubPath( 0, 10 );

// Start position of the path
Path.Begin( 0, 0.0, 10.0 );

// ... and the sequence of following line segments
Path.AddLine( 0, 100.0, 10.0 );
Path.AddLine( 0, 100.0, 110.0 );
Path.AddLine( 0, 200.0, 110.0 );
Path.AddLine( 0, 200.0, 10.0 );
Path.AddLine( 0, 300.0, 10.0 );

This is the result in Embeded Wizard:

I hope it helps you further.

Best regards

Paul Banach

by
Hello Paul,

Yeah, I tried adding single segment each time and it works.

Thanks for the quick response!

Regards,

VIkas

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...