How to set a static width for a gantt cell - gantt-chart

I'm using dhtmlx gantt component to render a Gantt chart and I need each cell in the timeline to have a fixed width, 10px for example, I tried to use the attribute min_column_width and it does make the columns smaller but it's not using the desired width, is there any way to use a static width?
Here is a snippet https://snippet.dhtmlx.com/5/c4362d05c
And I need each one of these cells (the ones of the headers and the ones where the tasks are) to have a fixed width. I appreciate any help or insight on this :) Thanks for reading!

Unfortunately, there is no built-in way to set a fixed timeline cell width. The dev team will try to add that feature, but I cannot promise that.
For now, you need to implement a custom solution.
The timeline cell width depends on several things:
• The gantt.config.min_column_width parameter.
• The displayed date range.
• Gantt container size.
When there are many cells displayed in the timeline so that all of them won't be able to fit the Gantt container size, Gantt uses the min_column_width parameter and adds a scrollbar.
If the cells are able to fit the Gantt container size or even take a smaller size, Gantt stretches them.
So, to have the exact timeline cell size, you need to increase the visible date range:
http://snippet.dhtmlx.com/5/f4f37b79b

Related

Add padding to row heights in XLSX with Apache POI

I have some code that outputs an excel file using POI and I want to have it so that my Row heights have a bit more space than the automatic heights that get set if I do nothing.
Currently i get a row using sheet.createRow(rowNumber) and then I don't set the height at all, and excel / POI just seems to take care of that.
I now want to add a buffer to the automatically set heights, (say 20px) but I cant see a way to do this, when I add my cells it doesn't seem to actually set the height property of the row automatically, so I can't do row.setHeight(row.getHeight()+20) because getHeight just returns the default height, and so all my Rows end up the same height, instead of the auto height + 20.
Similarly if i set the Default height of the sheet it doesn't bother automatically working out heights for anything that needs to be bigger than the default.
Is there a way to do this?
Actually you're using the right API but as Axel Ritcher pointed out, there is no concept of padding for a cell. The only problem is that 20 is such a tiny value that you can't see any notable difference. You can try something like:
row.setHeight((short)(row.getHeight() * 2));

Conditional Formatting of donut chart

All,
I have a donut chart that indicates widgets that passed inspection as a percentage over total widgets (passed and failed). What I am trying to do is add some kind of conditional formatting to the ring segment that shows percentage of widgets that passed inspection, based on the percentage of widgets that actually passed inspection, such that the whole segment is either red if less than 75% passed, yellow if up to 90% passed, and green if over 90%
All,
Just thought I'd let you know I found a way to accomplish this. First, I created a column chart for widgets and for my different color schemes (such that we would have a clustered column chart with two clusters). Then, I set the widgets passed column chart to a secondary axis.
Next, I changed the chart type of both axis to a donut chart (note, donut charts do not let you set a secondary axis directly, which is why we have to do this in a column chart or line chart first).
Next, for the data series representing the different colors, I used the formulas =if([passed]>=.9,1,0), =if([passed]>=.75,1-R[-1]C,0), and 1-sum(R[-2]C:R[-1]C) to fill the values for the ring on the primary axis that is to represent different colors.
After this, it was simply a matter of adjusting the formatting on the primary and secondary axis, making the [passed] ring segment transparent, and using 1-[passed] to calculate a failed segment of widgets.
I hope that made sense to anyone else trying to accomplish this, but let me know if any questions (or if you have done this before and have a better way to explain, fill free to edit this).

Susy: fluid columns with fixed gutters?

I'm trying to build a 12 column grid with fluid columns and fixed gutters. Columns would change width as the window resizes, but the gutters would remain constant. Basically, percentage for columns, ems for gutters.
Is this possible with Susy?
You could use the padding as your gutter and would allow you to have a fixed "spacing" while keeping the fluid nature of the grid.
This would however force you to add extra markup if you need backgrounds that doesnt extend to the "gutter" area.

Different size items in a VariableSizedWrapGrid

The app I'm working on uses a grouped GridView. Different templates are being used for different items on display and this is causing me an issue with the layout because the VariableSizedWrapGrid sets the row & column sizes based on the first item in each group.
I've tried to use the commonly-suggested solution of PrepareContainerForItemOverride and I'm encountering two problems:
It seems that I can only adjust the height & width around multiples of the column & row spans. That can leave me with quite a bit of wasted space if, say, item #2 needs to have 1.5 x the row height of item #1. I also seem to have to "guess" at what the most appropriate multiple is, which doesn't seem to be appropriate when apps are supposed to scale dynamically.
If I get the multiples too big, the content is horizontally & vertically centred. I've tried changing the alignment from stretch to left in various places but I cannot find which control property to set to get this to work.
Is there a better way of adjusting the item sizes than grid spans? If there isn't, is there a better way for me to lay out my content with variably sized items?
Thanks.
http://winrtxamltoolkit.codeplex.com/ includes WrapPanel which does the job perfectly. It stacks the individual items either horizontally or vertically and wraps onto the next row/column as required.

Excel: Stretching a graph on x axis

In my graph, the x axis are text values. When I make the graph, I cannot stretch it to the whole width. Instead, it takes only less than half of the width.
I usually do this by clicking on "Format Axis", but it doesn't offer that in this case.
Here is the screenshot:
I'm using Excel for Mac.
When you made the chart, did you select a bunch of empty rows below the range that actually contains data? Looks like twice as much empty data as data with values.
If you select the plot area or chart area, you can see the source data of the chart highlighted in the sheet. You can resize the highlighted range with the mouse to modify the amount of data in the chart.
Did they made different types for windows and mac? I'm using windows and scaling is never a problem here.
I can't give you any answer but I can give you a suggestion. Can you check the width of the numbers below the 'Number of public SLA templates' label? Its occupying all the width of your window.

Resources