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

Timechart series labels in the legend sometimes get truncated #28

Open
dmehra opened this issue Jan 19, 2016 · 1 comment
Open

Timechart series labels in the legend sometimes get truncated #28

dmehra opened this issue Jan 19, 2016 · 1 comment
Assignees

Comments

@dmehra
Copy link

dmehra commented Jan 19, 2016

When specifying secondary yScale for a series, resulting series names in the timechart legend get truncated even though there is plenty of free space. The truncation does not happen for the same names when using primary yScale. The use of -keyField doesn't affect truncation either way.

However, sometimes you can use much longer names without them getting chopped off, on primary or secondary axis, so I cannot narrow down the reproduction scenario.

This Juttle does reproduce the problem:

(
  emit -limit 100 -from :today: -every :minute: | put name = "Close", value = 100;
  emit -limit 100 -from :today: -every :minute: | put name = "Volume", value = 40;
)
| view timechart
  -series [
        {name: 'Close', geom: 'line', yScale: 'primary'},
        {name: 'Volume', geom: 'bars', yScale: 'secondary'}
    ];

image

Same but on primary yScale, no truncation:

(
  emit -limit 100 -from :today: -every :minute: | put name = "Close", value = 100;
  emit -limit 100 -from :today: -every :minute: | put name = "Volume", value = 40;
)
| view timechart
  -keyField 'name'
  -series [
        {name: 'Close', geom: 'line', yScale: 'primary'},
        {name: 'Volume', geom: 'bars', yScale: 'primary'}
    ];

image

Here is an example with much longer name, but using primary axis, and still no truncation:

(
  emit -limit 100 -from :today: -every :minute: | put name = "Close", value = 100;
  emit -limit 100 -from :today: -every :minute: | put name = "Volume (Such Long Name)", value = 40;
)
| view timechart
  -series [
        {name: 'Close', geom: 'line', yScale: 'primary'},
        {name: 'Volume (Such Long Name)', geom: 'bars', yScale: 'primary'}
    ];

image

But there must be more to this, because here is code that uses long names for both axes and no truncation happens:

(
  emit -limit 100 -from :today: -every :minute: | put name = "Closing", value = 100;
  emit -limit 100 -from :today: -every :minute: | put name = "Volume (Such Long Name)", value = 40;
)
| view timechart
  -series [
        {name: 'Closing', geom: 'line', yScale: 'secondary'},
        {name: 'Volume (Such Long Name)', geom: 'bars', yScale: 'primary'}
    ];

image

@dmehra dmehra added the bug label Jan 19, 2016
@dmehra
Copy link
Author

dmehra commented Jan 19, 2016

Note that this happens in our demo example stock_prices.juttle:

image

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

No branches or pull requests

2 participants