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

Bars on graph2d using sideBySide not equal width when missing items #500

Open
mdxs opened this issue Dec 8, 2014 · 5 comments
Open

Bars on graph2d using sideBySide not equal width when missing items #500

mdxs opened this issue Dec 8, 2014 · 5 comments

Comments

@mdxs
Copy link
Contributor

mdxs commented Dec 8, 2014

When adding partial data (explained below) to a Graph2D chart with the handleOverlap: 'sideBySide' option, not all bars show equal width. Setting the width option seems to be (as expected, and correctly IMO) ignored by the sideBySide option to ensure that all bars are visible. However, in doing so, the code doesn't determine a new width to apply to all bars. This results in different width bars.

Compare bars on Friday the 13th in http://jsfiddle.net/wijgerden/cttyhfgu/ with the same in http://visjs.org/examples/graph2d/11_barsSideBySideGroups.html where the only difference is that I commented out one item. What you can also see in the fiddle is that the two bars on Fri 13th are not seperated by the space that the missing bar would occupy otherwise.

It probably would be possible for me to provide 0 (zero) values for the missing items in my data, but this would increase the amount of data to be transferred/processed; and it might provide the wrong information (it is not that the value was zero... we simply didn't have the data available).

Is it possible to ensure all bars on a graph2d chart have equal width when using the handleOverlap: 'sideBySide' option? Ideally keeping empty space for missing items in above case.

@mdxs mdxs changed the title Equal width bars on graph2d when using sideBySide? Bars on graph2d using sideBySide not equal width when missing items Dec 8, 2014
@AlexDM0
Copy link
Contributor

AlexDM0 commented Dec 8, 2014

Hi,

The width you define is used as a width for a single bar (without overlap). That space is subdivided for overlapping cases.

If you have three datasets you want to compare and there are zero values in them, those are values too and should be shown. That is the idea behind the current implementation.

It is not possible to have blank spaces for missing values. You could fake this by having a group with an invisible style (rgba(0,0,0,0)) where you input your missing values.

Regards,

Alex

@mdxs
Copy link
Contributor Author

mdxs commented Dec 8, 2014

I understand it is the current implementation; so it probably is more of a feature request.

Thanks for the suggestion to use invisible group(s), plural as any of the groups could have missing items... there are some remaining issues; with the icons and the legend, but I can work around that. See http://jsfiddle.net/wijgerden/vq4ezLgn/ (an updated fork of the sample fiddle) where I applied this; note the blank icon outline (but the icons could be hidden of course).

@AlexDM0
Copy link
Contributor

AlexDM0 commented Dec 8, 2014

Hi,

Hmm. I didn't think of that. Maybe it would be useful to have the legend:true/false option for groups as well.

Regards,

Alex

@AlexDM0
Copy link
Contributor

AlexDM0 commented Jan 9, 2015

Hi,

Over the last year a lot of feature requests have been made. We have just introduced our new website which has a list of the requested features. We have placed this request on that list.

The list can be found here:
http://visjs.org/featureRequests.html

An explaination of the new system can be found here:
http://visjs.org/blog.html#New\ website\ for\ vis.js!

I would like to stress that this does not mean we abandon this request. Discussion here will continue if needed on this feature but we will close it to keep our Github issue page more of a bug-todo list.

Future feature requests will still be made here and then added to the website by us.

Regards,

Alex

@AlexDM0 AlexDM0 closed this as completed Jan 9, 2015
@mojoaxel mojoaxel removed the Question label Oct 24, 2016
@mojoaxel
Copy link
Member

Reopening as Feature-Request issue (see #2114).
Everybody: Please feel free to implement this!

@mojoaxel mojoaxel reopened this Oct 24, 2016
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

3 participants