GraphStream Users

Archives de la liste Aide


Re: pie-charts colors update


Chronologique Discussions 
  • From: Antoine Dutot <antoine.dutot AT gmail.com>
  • To: graphstream-users AT litislab.fr, remy <remy.cazabet AT gmail.com>
  • Subject: Re: pie-charts colors update
  • Date: Tue, 27 Mar 2012 11:11:16 +0200

Hi Remy,

Indeed, this was a bug. It should be corrected on the git repository, and the jar will be available for download in the nightly builds tomorrow : http://graphstream-project.org/pub/1.x/nightly-build/

In the meantime, note that changing the color (or colors for pie-chart shapes) of a node by changing its entire style is not the most effective way to do it. You can have a look at this page for more recommendations on how to dynamically change the style of an element : http://graphstream-project.org/doc/FAQ/The-graph-viewer/How-do-I-dynamically-change-color-and-size-in-the-viewer_1.1/

Thank you for your bug report,

Regards,

Antoine

Le 26 mars 2012 14:16, remy <remy.cazabet AT gmail.com> a écrit :
Hi,
I try to use pie-charts to represent my nodes, but I need to change their
colors dynamically.
I'm using
n.setAttribute("ui.style", "shape:pie-chart;fill-color:XXX").

It works well the first time, but if I do it again with new colors, it keeps
the old ones. It seems to be an actualization problem, because if I first
change the shape to a cross for example, then I can correctly set the colors
for the pie-chart anew. (But only if the cross is displayed. If I change to a
cross, them come back to a pie-chart without graphic update, it keeps the old
colors.)

To give a concrete example of the problem, if I write

n.setAttribute("ui.style", "shape:pie-chart;fill-color:red");

Thread.sleep(1000);
n.setAttribute("ui.style", "shape:pie-chart;fill-color:blue");

the node stays red.

Do you have a solution ? Thanks




Archives gérées par MHonArc 2.6.16.

Top of page