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

Is there a way to specify a label for a given value #16

Open
simogeo opened this issue May 5, 2014 · 2 comments
Open

Is there a way to specify a label for a given value #16

simogeo opened this issue May 5, 2014 · 2 comments

Comments

@simogeo
Copy link

simogeo commented May 5, 2014

First of all, thanks, your lib is great.
I'd like to know if it is possible to add a custom label on mouseover.

Taking an example, it would be :

d = [
     [
           {axis: "strength", value: 13, mylabel: "Congratulations"}, 
           {axis: "intelligence", value: 1, mylabel: "So bad"}, 
           {axis: "charisma", value: 8, mylabel: "Not that bad"},  
           {axis: "dexterity", value: 4, mylabel: "Some efforts are needed"},  
           {axis: "luck", value: 9, mylabel: "Not that bad"}
          ]
];

Is that possible? On the roadmap ? Easy to implement ?

Thanks for your reply

@alangrafu
Copy link
Owner

Hi!,

I'm afraid I don't have much time to work in rachar-chart-d3 for the next months, but I think it would be a nice pull request ;-)

I can imagine passing something like

d = [
     metadata: {
                            title: "Title of this serie",
                            foo: "bar"
                      },
     data: [
           {axis: "strength", value: 13, mylabel: "Congratulations"}, 
           {axis: "intelligence", value: 1, mylabel: "So bad"}, 
           {axis: "charisma", value: 8, mylabel: "Not that bad"},  
           {axis: "dexterity", value: 4, mylabel: "Some efforts are needed"},  
           {axis: "luck", value: 9, mylabel: "Not that bad"}
          ]
];

My only concern would be to keep it backwards compatible with existing configurations, so you would need to check if what you are receiving is an array or an object with data/metadata keys.

@simogeo
Copy link
Author

simogeo commented May 12, 2014

Thanks for your quick reply. I'm sorry but I had to switch to a non d3 library. I keep your lib and the idea in mind in case of I need it for another project.

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

No branches or pull requests

2 participants