frappe/charts

Truncate tooltip labels & stack values vertically

Open

#198 opened on Sep 27, 2018

View on GitHub
 (4 comments) (6 reactions) (0 assignees)JavaScript (769 forks)batch import
Feature Requesthacktoberfest

Repository metrics

Stars
 (14,858 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi there.

Firstly, thanks for an amazing lib! It's a breeze to use : )

I'm wondering if under tooltipOptions I could also pass in a format method to deal with long labels?

Ideally (expected behaviour)...

tooltipOptions: {
  formatTooltipX: d=> (d + '').toUpperCase,
  formatTooltipY: d => d,
  formatTooltipLabelY: d => (d + '').substring(0, 10) + '...'
}

Edit: Another request would be to list the values vertically stacked instead of horizontally. This would allow users to avoid situations like these: screen shot 2018-11-02 at 10 44 37

And allow for tooltips which are better to grasp (cognitively), like these: screen shot 2018-11-02 at 10 44 57

Contributor guide