taitems / jQuery.Gantt

jQuery Gantt Chart
http://taitems.github.io/jQuery.Gantt/
MIT License
952 stars 304 forks source link

Bars in the middle of cells #222

Closed LuigiMdg closed 6 years ago

LuigiMdg commented 6 years ago

Hi.. I can set the bars in the middle of grid cells? From this To this

usmonster commented 6 years ago

Hello! Thanks for using the plugin. I'm not sure your use case, but there's no clean, built-in way to do that today. One not-so-clean/hacky way to do this is to add a rule somewhere in your page's CSS:

.fn-gantt .bar {
  margin-left: 12px;
}

Though there might be some edge cases that could give undesirable effects, so you may want to test it.

Otherwise, depending on your actual need, you may want to follow #47, which will allow the chart items' positioning to more realistically reflect its time bounds.

I'll close this issue for now, but if none of these solutions address your issue, I can reopen it. Hope this helps!

LuigiMdg commented 6 years ago

n. 47 is perfect for me.. But the topic is very old..! You can't update with this feature? This plugin is very good and can have a good evolution and much stars

For now, I've solved changing in the CSS this: margin: 0 3px 3px 0;

To this: margin: 0 3px 3px 12px;

And in the js I've changed this: width: h * b - j + 2 To this: width: (h * b - j + 2) - 12