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

Add additional informations to tick #2144

Open
mpushki opened this issue Aug 16, 2017 · 0 comments
Open

Add additional informations to tick #2144

mpushki opened this issue Aug 16, 2017 · 0 comments

Comments

@mpushki
Copy link

mpushki commented Aug 16, 2017

i have format for tick:

           tick: {
                fit: true,
                multiline: false,
                outer: false,
                format: function (x) {
                    var value = this.api.categories()[x];
                    if(value.length > 5)
                        return value.substring(0,5)+"...";
                    else
                        return value;
                }
            },

value - unique attribute. But now - i should cut it by 5 symbol.

and i have click on tick:

_.each(this.chart.element.querySelectorAll('svg g.c3-axis-x .tick text tspan'), (el) => {
el.onclick = (e) => this.someFunction(e)
})

in someFunction() - i want to get unique attribute to get data for current tick.

Earliest i got this attribute like angular.element(e.target).text() but it can contain сropped attribute. How i can get current index? or something else to get full text

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

1 participant