Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(legends): improve legends support #224

Closed
wants to merge 1 commit into from
Closed

Conversation

plouc
Copy link
Owner

@plouc plouc commented Jun 5, 2018

@plouc plouc self-assigned this Jun 5, 2018
@plouc plouc force-pushed the feat/improve-legends branch 9 times, most recently from 9405815 to 5f5a906 Compare June 5, 2018 18:33
@plouc plouc force-pushed the feat/improve-legends branch from 5f5a906 to 37ca0d9 Compare June 5, 2018 20:25
@iohcidnal
Copy link

Thanks for the great work. This PR will really help a lot of us. When do you think we can have this? @plouc

@ArtieReus
Copy link

This PR sounds very good! It is possible to pass custom Rects, like for the bar chart passing customBar?

@plouc
Copy link
Owner Author

plouc commented Jul 15, 2018

@ArtieReus, you mean custom symbols?

@ArtieReus
Copy link

@plouc yes, simbols. I need to select items from the legend to filter the chart.

@iohcidnal
Copy link

Is there any chance this will be merge?

@plouc
Copy link
Owner Author

plouc commented Aug 25, 2018

@ArtieReus custom symbols have been implemented.

@plouc
Copy link
Owner Author

plouc commented Aug 26, 2018

I've split this PR, onClick, onMouseEnter and onMouseLeave support has been added, Waffle and WaffleCanvas now support legends.

@wulucxy
Copy link

wulucxy commented Nov 5, 2018

so,how can I test this feature。I can't still see anything changed in this PR。

@wulucxy
Copy link

wulucxy commented Nov 10, 2018

hi,@plouc , i finally manage to run this feature。but I still have problem to toggle series show/hide。
every time when I click the legend,I need to setState to remove the current series,the problem is the legend keys is also removed,because it is sync with the data。

so,what‘s your suggestion?

@plouc
Copy link
Owner Author

plouc commented Nov 10, 2018

@wulu, I plan to add support for passing legend data instead of guessing it from the data itself, it should work, however I don't know when I'll be able to do so as I already have some ongoing features.

@wulucxy
Copy link

wulucxy commented Nov 12, 2018

@wulu, I plan to add support for passing legend data instead of guessing it from the data itself, it should work, however I don't know when I'll be able to do so as I already have some ongoing features.

it seems interesting。how about create a demo,and i am willing to take it to action?

@J1marotta
Copy link

Will this PR contain any documentation for the Effects part of the legends? it seems to be missing from the Api docs.

would greatly appreciate it.

@lourenci
Copy link

lourenci commented Jan 9, 2019

Will this PR expose some way to rendering the legends outside of the component? That would solve those #274, #253 issues.

In the chart below, I can't fit the legends in it. There are a lot of legends with big words. My solution for now is disable the legends in it.

image

Thanks for the library.

@plouc
Copy link
Owner Author

plouc commented Jan 15, 2019

I've kept this PR to be able to pick features from it, however it won't be merged.
@lourenci it doesn't include this feature but I'd like to add it to the lib, but I've no idea of when, it depends on the time I can spend on the project which is very limited for now.

@martin-kieliszek
Copy link

martin-kieliszek commented Apr 21, 2019

I'm excited for this change to be available

Edit: For more clarity (since I received some eye emojis, haha, please forgive! @rtroncoso @StanislavVoronov ):

Clarifying:
I was excited with regards to @plouc comment

I plan to add support for passing legend data instead of guessing it from the data itself, it should work, however I don't know when I'll be able to do so as I already have some ongoing features.

So that if I decide to "toggle" my data (by removing one of the id's and its relevant data) - it won't remove a legend entry as a consequence of my data being removed. (Please let me know if in fact this legend data change has been pushed - I may very well have overlooked this - such that I can specify my array of legends regardless of what data I have passed in)

I was excited to perhaps have something similar to hiddenIds option available on aLine graph - for the sake of being able to toggle my data series as seen below

Waffle - toggle series via Legend on click handler

If there is already an existing work around you guys know of, with regards to toggling data series without losing legend. I'd be grateful to see your recommendation :)

Kind regards and all the best

@plxel
Copy link

plxel commented Oct 3, 2019

Maybe you can add prop for custom legend and just pass all props you pass now into your legend to this custom render prop
And then anybody can implement any legend they want

@dkim-thomas
Copy link

dkim-thomas commented May 19, 2020

Is there a way to customize/edit the legend for the pie chart as well? @plouc

Scenario:
Would like my legend to use the following label and output the value and estimatedPosition.

Sample Data
{
id: "96140926",
label: "My Custom Label",
value: 11,
estimatedPosition: "1"
}

Desired Output
My Custom Label: 11 (estimated position: 1)

@stale
Copy link

stale bot commented Oct 29, 2020

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@stale stale bot added the stale label Oct 29, 2020
@sattuchin
Copy link

This feature would be very useful. Please prioritize when possible. Thank you!

@stale stale bot removed the stale label Nov 3, 2020
@plouc plouc closed this Dec 23, 2020
@Lisakirj
Copy link

Would be nice to have possibility to add another dataFrom for barChart legend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.