How to draw block style graph instead of curve graph ?

32 views
asked Jan 24 in GUI Development by Vikas Rokade

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
answered Jan 24 by Paul Banach

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

commented Jan 27 by Vikas Rokade
Hello Paul,

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

Thanks for the quick response!

Regards,

VIkas

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...