Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

showMajorLabels to false and scale set to 'week' creates vertical lines display bug #3246

Closed
Franzyval opened this issue Jul 10, 2017 · 6 comments

Comments

@Franzyval
Copy link

Hello and first, thanks for this really useful tool :),

I think i have identified a bug: when setting both options showMajorLabels to false and timeAxis to { scale: 'week', step: 1 }, there is a display bug for vertical lines where months were supposed to be. this seems to just be a display bug.

on version 4.20.0 of the Timeline

Here you can see that the div for week 22 appears two times
bug-timeline

here is sample code to reproduce :
var container = document.getElementById('example-timeline');

// Create a DataSet with data
var data = new vis.DataSet([{
id: 1,
content: 'First event',
start: '2014-08-01'
}, {
id: 2,
content: 'Pi and Mash',
start: '2014-08-08'
}, {
id: 3,
content: 'Wikimania',
start: '2014-08-08',
end: '2014-08-10'
}, {
id: 4,
content: 'Something else',
start: '2014-08-20'
}, {
id: 5,
content: 'Summer bank holiday',
start: '2014-08-25'
}]);

// Configuration for the Timeline as JSON object
var options = {
showMajorLabels: false,
timeAxis: {
scale: 'week',
step: 1
},
width: '100%',
locale:'fr',
editable: true,
margin: {
item: 20
}
};

// Create a Timeline
var timeline = new vis.Timeline(container, data, options);

Thanks !
Regards

@bradh
Copy link
Contributor

bradh commented Jul 10, 2017

Can you try with 4.20.1? If it still happens, can you create a jsbin or jsfiddle that shows the problem?

@Franzyval
Copy link
Author

Hi, thanks, for your interest in this problem,

https://jsfiddle.net/e7uodse2/1269/
this jsFiddle is using vis 4.20.1, error still occurs. Look for week 27 or week 40

ponml added a commit to ponml/vis that referenced this issue Jul 26, 2017
yotamberk pushed a commit that referenced this issue Aug 12, 2017
… scale. (#3305)

* fixes showMajorLabel issue in #3246

#3246

* fix at TimeStep level, for weekly mode, when showMajorLabels == false

* pass options in TimeStep construction
@marcortw
Copy link
Contributor

Nice to see that people are using the week scale feature! I only saw this issue now and I am not sure if there's a misunderstanding here. The additional vertical line at the month's start is a feature, not a bug. See my comment in #3009 (comment) . @yotamberk, do you remember this discussion?

Additionally, this fix seems to break the weekStyling.html example:

image

@yotamberk
Copy link
Contributor

@marcortw egh... You're right... The bug in the example is problematic...
I forgot that discussion but I do agree with @Franzyval that the extra line looks funny.
@Franzyval Can you please fix the problem in the example?

@marcortw
Copy link
Contributor

Yes, I agree that the extra line looks funny in the case when the major labels are not used. As it looks like, this fix keeps the extra line when major labels are used, which seems to be a good approach. So if the label bug is fixed, then this seems to be fine.

There's another issue visible in the above screenshot, which I was already aware of: If major labels are used, the following div overlaps the previous week number (here the cut off undefin.. string). This also happens for week numbers sometimes. Should I open another issue for that? Tbh, I wasn't that keen on fixing it initially because the whole TimeStep thing seems to be a bit too unflexible for these kind of things.

@yotamberk
Copy link
Contributor

The overlap is due to the div of the major being after the minor label and with a background (hence the overlay), Not much can be done with that.

yotamberk pushed a commit that referenced this issue Aug 16, 2017
* weekly scale minor label fix

* don't break lint guidelines

* ignore linting
primozs pushed a commit to primozs/vis that referenced this issue Jan 3, 2019
… weekly scale. (almende#3305)

* fixes showMajorLabel issue in almende#3246

almende#3246

* fix at TimeStep level, for weekly mode, when showMajorLabels == false

* pass options in TimeStep construction
primozs pushed a commit to primozs/vis that referenced this issue Jan 3, 2019
* weekly scale minor label fix

* don't break lint guidelines

* ignore linting
mojoaxel pushed a commit to visjs/vis-charts that referenced this issue Jul 12, 2019
… scale. (#3305)

* fixes showMajorLabel issue in #3246

almende/vis#3246

* fix at TimeStep level, for weekly mode, when showMajorLabels == false

* pass options in TimeStep construction
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants