Skip to content

Conversation

@Indigo744
Copy link
Collaborator

Legend options can now be updated in the update event.

$(".mapcontainer").trigger('update', [{
    legend : 
        area : {
            title :"Areas updated", 
            slices : [...]
        },
        plot :{
            title :"Cities updated",
            slices : [...]
        }}]);

Working JSFiddle: http://jsfiddle.net/60p8ukyn/1/

Related issue: #43

The event `update` is extended to allow the modification of the legend (area or plot).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this. I don't really understand what happened...

@neveldo
Copy link
Owner

neveldo commented Nov 1, 2015

Great new feature ! I have run some tests and it works fine. I just add a little comment on the source code.

In order to reset the legends collection because we re-create all the legends from scratch, otherwise the collection will keep the previous obselete legends.
@Indigo744
Copy link
Collaborator Author

As you suggested, I think once all PR are merged, I can make a new PR to remove the legends var.

neveldo added a commit that referenced this pull request Nov 1, 2015
@neveldo neveldo merged commit 993cc28 into neveldo:master Nov 1, 2015
@Indigo744 Indigo744 deleted the Indigo744-patch-legend-update branch November 2, 2015 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants