TVirtuailStringTree vertical align text to bottom - tvirtualstringtree

How to align the cell/node text to bottom in TVirtualStringTree? I can't find any property alignment in virtual nodes so I'm sure I have to deal with OnDraw events. Sad to say I'm not good with dealing with custom draw unless a sample is provided. Can someone provide an example how to do it?

Related

How to add multiple geojsons to a geochoropleth in dc.js?

I'm trying to create a geochoropleth that maps subregions, but also includes outlines of larger regions. (You can think of it like mapping counties, but then wanting to include thicker outlines of states). Not all subregions are part of larger regions that need to be outlined. (Most aren't.) You can see an example of what I'm trying to replicate here:
What's the best way to add this regional outline to my map? I've tried keeping the regions and subregions as two separate files, with two overlaygeojsons calls in my geochoropleth call (with added d3 styling to change the fill and stroke to just be an outline). But when I do - the projection of the regional outline layer is strangely offset from the lower one.
I've also considered having both sets of boundaries in just the one geojson. However, I wasn't sure how to work with this.
While it would be nice to be able to mouseover the boundaries of the larger regions and get a tooltip before crossing over into the individual subregions and getting their tooltips, this isn't a must. I could live with just outlines around the regions. Please advise on the best way to do this. Happy to provide more detail, and thanks so much!
EDIT: I discovered that I had a misplaced transform tag which is what offset the second layer. Fixed now!

Match numerical data points with pre-defined grid

I have data from some experiment that should resemble a known grid-structure. However, the data
is off by some unknown angle
is distorted in an unknown way
may contain some displaced points
For an example, please have a look at this picture:
As you can see, the (nice looking) grid is distorted (the angle between the red indicators I drew is not 90deg) and is also rotated a little bit (the horizontal red line is not really horizontal). In addition, on rhe right top and bottom you can see some defects of the structure.
Are there tools I could use to match the data to some grid that I define and thereby find out the corrected data point positions? If not, could you give me some hints to appropriate algorithms to accomplish this? I have googled and thought for a while, but did not come up with a nice (and simple) solution.

Geometry of fonts

If I want to draw a text on a control, I can get "a bounding rectangle" first and place it at an appropriate place (using GetTextExtentPoint32 function).
But I also need to know where some baselines are, e.g the two red lines in the picture.
(Their positions are calculated respect to the top of the bounding rectangle.)
I didn't figure a way to get these information. Please help.
The function GetTextMetrics will get you this. Select your font into the DC first, then call GetTextMetrics. The fields tmAscent and tmDescent of the TEXTMETRIC structure are probably the ones you need.

overlapping text on the coreplot pie chart

What is the best way to prevent overlapping text on coreplot? Especially when some of the slices may be quite small? The overlapping text appears at the bottom, I think that it runs out of space to put it anywhere and thus must pile one label on top of the other.
I could reduce the size of the pie chart, but is there a more elegant way of achieving this?
Mark
Core Plot doesn't do anything about overlapping labels right now. You have to use your knowledge of the data and remove some of the labels that might be too close together.

UILabel sizing during device rotation

In my app I have two labels. Second one should be positioned below the first one (with some small const padding). The first label is multi-lined and takes all possible width. So after changing interface orientation, its real height can change (because necessary line number can change). That's why autoresizing mask can't help me here.
So.. How can I control this and display labels correctly even during interface orientation change animation?
Damn. I'm so sorry about this question. I've really googled before asking and tried to read docs. But somehow I've missed this and this with great details about my question.

Resources