715 views
in Getting started by

Hello,

   I started using Embedded wizard two days ago and I wanted to try the Graph tool.I tried to add a predefined list of coordinates ( simplest method to test the tool ) I started by adding a graph and a coord list and I overrided the UpdateViewState method and this is the code used in the method :

aState;

CoordList.AddCoords ( 150 , 360);

CoordList.AddCoords ( 300 , 120);

CoordList.AddCoords ( 480 , 220);

Graph.Coordinates = CoordList;

But nothing appeared in the screen. I red the Charts::CoordList and the  Charts::Graph but it's not clear. I also tried to examinate the ChartDemo and the ClimateCabinet but it's still not clear.

Thank you for your help.

 

1 Answer

+1 vote
by
Hello,

the method UpdateViewState() is called from the Mosaic framework in order to update a component due to some state changes. This is not the right location to add data to your graph!

In order to test the graph class you can do the following:

Add a button to your application, create a slot method (e.g. onAddCoords()) and connect the OnActivate property of the button with the slot method.

Within the slot method you can add your test code. As a result, when you press the button, the graph should display the lines.

Does it work?

Best regards,

Manfred.
by

Thank you for your quick reply. Sadly, I did What you said and it still doesn't work... So here's a screenshot of what my workspace looks like (I added the Slot to the OnActivate property of the button)

 

by

After adding the coordinates you have to assign the list of coordinates to the graph object:

Graph.Coordinates = CoordList;

Does it work now?

by
I added it in the UpdateViewState method (like most of the examples ) but it didn't work . Now I switched it into the Slot method, still didn't work ... at this point I think there is something wrong with my PC. I'm maybe asking for too much here but can you just create a simple project with the Graph and the CoordList please ?
by

Hello,

please find here a simple example, that demonstrates how to add coordinates to the CoordList and how to show them with the Graph class. You can either set a X/Y value with the sliders and press 'Add' to add the current position to the list or you can create simple random values.

I hope this helps...

Best regards,

Manfred.

 

by
Thank you so much! This really helps! it's exactly what I was looking for! Thank you again.

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

...