How can I enlarge the spacing between the x axis labels to the y axis labels?
Related
How do I change the font size on the labels on any chart radar chart?
AnyChart Radar Chart Example
Text labels are on the X axis:
// adjust x axis
chart
.xAxis()
.labels()
.fontFamily("Iosevka")
.fontSize(28)
.fontColor("#000")
.fontWeight("bold");
Numbers are on the Y axis:
// adjust x axis
chart
.yAxis()
.labels()
.fontFamily("Iosevka")
.fontSize(28)
.fontColor("#000")
.fontWeight("bold");
I'm using opencv, I have left, right, top, bottom co-ordinates of a rectangle.
I want to measure width and height of the rectangle in centimeters. How do I do that?
I tried to find euclidean distance like this:
D = dist.euclidean((top, left), (top, right)), but am not sure whether it is right or not, because I want a value of height and width in centimeters
Code segment that I use to determine the co-ordinates
(xmin, ymin, xmax, ymax) = (box[num][1], box[num][0], box[num][3], box[num][2])
(left, right, top, bottom) = (xmin * im_width, xmax * im_width, ymin * im_height, ymax * im_height)
I have a helper view with dynamic height in my storyboard, this is a common practice to make layout responsive.
However, something strange happens when I introduce multipliers.
The blue button is aligned center y to the white view on the left:
Changing multiplier value into 0.5 should align the button to center of first half of the white view, at least it works this way when aligning to superview.
Instead I end up with sth like this:
The blue button height is equal to 0.05 times th height of the superview. The white view height is equal to 4 timees the height of the blue button
I have no idea what is the problem here that causes this weird alignment. I suspected it might be something with dynamic height value, so I tried setting explicit height value but the result was exactly the same.
You said that if button is Center Y with multiplier 0.5, than it should be positioned at the 1/4 of that white view.. No thats not worked like that .. lets check it with equation
multiplier works with this equation
FirstItem.Attribute1 = (SecondItem.Attribute2 * Multiplier) + Constant
Your constraint is Button.Center Y = BlankView.center Y .. so this is how equation filled up
Button.Center Y = (BlankView.center Y * 1) + 0
So the question is what is the value of BlankView.Center Y ...
answer is
BlankView.Center Y = HeightOfSuperviewOFBlankView - (Y positionOFBlankView + (BlankViewHeight / 2))
// in your case it would be 603 - (483 +(120/ 2)) = 543
Now move to Your equation Center Y with multiplier 0.5
Button.Center Y = (543 * 0.5) + 0 // 271.5
because of that your button position with Center Y is placed at
Button.Center Y = 271.5 - (buttonHeight / 2)
// if we take buttonHeight = 30 than it should be 257.5 (approx 257)
I hope now you understand how center Y with multiplier works...
I am using [_graph.defaultPlotSpace scaleToFitPlots:[_graph allPlots]];
and if where none of the plots has a y value of 0, there is a gap between the bottom of the Y axis and the X axis.
I've tried using _graph.axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0);
as well as a calculated yMin instead of 0.0.
Yet, I still get this:
I've also tried to rescale the plot space, thus:
[_graph.defaultPlotSpace setPlotRange:r forCoordinate:CPTCoordinateY];
but couldn't figure out how to set a new minLimit for r.
Use the axisConstraints to position the x-axis at the lower edge of the plot area:
x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];
the above graph shows the congestion between x and y coordinates how can that be avoided?
You can also add an offset to the labels of either xAxis or yAxis with
xAxis: {
labels: {
x: 5,
y: 5
}
}
This will move the label 5 points relative to the axis.
Increase the scale on the X axis by for example formatting x axis data to a Date without time information?