How to set variable cell spacing for cells in UICollectionView - swift3

I have a CollectionView with custom cells and I want to have different spacing between each of these cells. Using minimumlinespacing, it affects all the cells. Is there anyway to specifically change the spacing between 2 specific cells? Thanks!

There are more than one way to solve this.
You can use sizeForCell method to resize your specific cell according to indexPath
You can create two cells: one for more spacing, second with compact spacing and call dequqeResuseableCell accordingly.

Related

QTableView, strech all section but the last one resize to content

My table consists of 2 columns: the 1st one stores some strings, the other contains a checkbox only. To make my table a little bit fancy I want to stretch the whole table to the width of its view.
Using
setStretchLastSection(true);
solves the 1st problem. The table looks better, but... OK... the last column is a bit large.
Also I can use
setSectionResizeMode(QHeaderView::Stretch);
The table looks great, but... It isn't my desire. The 1st column should be optimally at least 90% of view's width and the 2nd one small since it contains one checkbox only. Additionally the table shoub be stretched to the view's width. Any Ideas?
Here is a picture just to make my question more understandable)
Here is the solution:
Disable the stretch option for the last column
setStretchLastSection(false);
Set a fixed width for the last column
setColumnWidth(1, fixedWidth)
Stretch the first column
setSectionResizeMode(0, QHeaderView::Stretch)
a bit fancy look

Why can't I sort this PowerBI chart?

I have charts I want to sort descending. I've read there's a "more options" option if you click on the chart, which should give you ability to sort.
In chart below, there is no sorting option:
Here is the field the chart is based on (it's a single field):
And here's the way I set up the chart:
I click 'more options' and yet see no option to sort. Who knew such a simple task could be that difficult in PowerBI.
My best guess at this point is that you are using two different fields for Male and Female numbers. If this is the case, you won't get the sorting option since the values are coming from two different fields. If you simply want to interchange the position, you can do so in the values section. If this is not the case, please provide further details, so that we can look into it further.
Edit:
I don't think there is a sorting option without having a value in Axis. However, you can adjust the Inner Padding of the Y-axis (in the formatting pane), to get the visual you are looking for. Setting inner padding to 0% will remove all the gap between the two bars. Also, you can do the sorting now, since there is a value in the Axis box.
Note: If you want different colors, add the field in legend as well.
You are using a clustered bar chart. The columns are arranged alphabetically and can't be changed.
If you want to sort the bars by their values, use a regular stacked bar chart and put the "demo_female" in the Axis, not the Legend.

Highlight external element on ChartJS hover

I want to be able to generate a chart and when parts of the chart are hovered (i.e. the point on a line graph), I want corresponding elements to have a class added to it on hover. Presumably by passing an array of elements to the hovered data point.
Is this possible in ChartJS? If not, can you recommend a chart software that is capable of this?
I achieved what I wanted with this answer:
https://stackoverflow.com/a/26258671/874691.
Here is my prototype: http://srgunltd.co.uk/chart.html

It is possible to hide part of labels google chart

I want to hide couple labels, first 2 and last 2 in axis X.
I want to disable black line at the bottom of the graph.
I'm able to do it after the chart is loaded - using javascript and change it dynamically. When I add new data and use draw method, Graph is overwriting my dynamic stylesheets changes. I was trying to set it as an option in graph initializer but I couldn't find the solution for that.
I use areaChart.
It was 3 years ago. I don't need it anymore. I'm leaving this question for others.
It's a little hard understanding what you're trying to do, but I think I get it.
As I read it, you want to eliminate two variables from your DataTable when you plot your chart (to prevent them from being in the legend)? Assuming that's the case, you can either take them out of the data table, or use a ChartWrapper on your object, and set the view:{columns:[x,y,z]} option to the ChartWrapper. Assuming you can't change the DataTable, or a ChartWrapper isn't an option, and you just want to not have certain plotted objects appear in your chart but not in the legend, you want to set the series option. For example, assuming three columns in your DataTable, you can hide the third item as:
series: [{visibleInLegend:true}, {visibleInLegend:true}, {visibleInLegend:false}],
Second of all, if you want to hide the horizontal axis, you need to have continuous data, and set hAxis.baselineColor to 'clear'.
To hide some of the tick-mark labels, use ticks: ticklist to label the axis, and for some of the labels in ticklist use an {v:value,f:label} structure definition, with a zero-length string for the label.
Here's an example. Note the omitted labels for some of the ticks on each vertical axis. View source to see how I did it:
http://www.sealevel.info/co2_and_ch4c.html
Note the tick list definitions. This one is for the left vertical axis:
var vticklist1 = [{v:235,f:''},{v:250,f:''},275,300,325,350,375,400,{v:425,f:'ppmv'}];
The first & second ticks (at the bottom, for values 235 and 250) display no labels. The next six ticks, for values 275-400, display normally. The last (top) tick displays as "ppmv" instead of 425. The result looks like this:

Custom CListCtrl

I need to create a ListControl in MFC, each row having different number of columns.
How can I do this?
That's not possible. The workaround is trivial, just don't put any text in the sub-item.
You may refer to my guru's(Chris Maunder-Codeproject founder) article:
http://www.codeproject.com/KB/miscctrl/gridctrl.aspx
You could use custom-draw List Control. Then you can specify maximum columns for the control, but draw only specified number of columns in each row. You can fill unwanted columns with a background color. Here's a sample of how you could create custom-draw list control.