TeeChart Left Axis Label MisAligned - delphi

How can you get the vertical (left or right) axis label to align with the major tick mark when the label angle is 90 or 270?
You can set it in the chart editor under Chart|Axis|Left (or Right|Labels|Options - Position: set to "After Tick". And this would be great if the property change was saved. However, it is not.
I could do this in code if I knew what the property name was and the property attributes were.

This is TChartAxis.Texts.Position of TAxisLabelsPosition type, for example:
Chart1.Axes.Left.Texts.Position:=lpAtTick;

Related

Mirror the scale from the bottom axis to also appear in the top axis

I have a simple 0-100 range of values representing percent using HorizontalBar and the TChart (Embarcadero edition) appears on a ScrollBox in this FMX app because I don't like the panning behavior I've seen in this Delphi 10.3.3 app for Windows. But the use of the ScrollBox means that sometimes the Bottom Axis is not visible, so I would like to have its Scale repeated as the TopAxis Scale.
Just having the Visible box checked for the Scale of the TopAxis does not produce the desired result.
Currently, I have a crude work-around that uses a separate chart that only exposes its BottomAxis Scale, positioned as a TopAxis Scale in the TChart that shows the data.
Is there a way to specify having the same scale on the bottom and top of one TChart?
On the series set the general option "Horizontal Axis" to Top and Bottom and for "Vertical Axis" to Left and Right.

TeeChart change distance between axis title and axis DELPHI XE3

I have chart where at the bottom axis dates are shown. The date string I have splitted into two lines. In the first is the date and in the second is the time. My problem is now, that the labels and the axis title are overlapping -> see image:
I googled for a while but found no solution or option I can use to set the distance between the axis title and the axis. The property
TChart.MarginBottom only changes the margin between the plotting area and component border. I have tried different properties to set the title vertical position:
// chtData is of type TChart
chtData.BottomAxis.Title.VertTextAlign := TVertTextAlign.vtaBottom; // Did not change anything
chtData.BottomAxis.Title.Margins.Top := 20; // Did not change anything
Is there any property I do not see?
Thank in advance for your help!
It seems there is no automatic calculation of labels' height
Seattle TChart:
in Obj. Inspector: BottomAxis - Labels - LabelSize set value 32
in chart editor: Axis - BottomAxis - Labels - Style - Size
in code: Chart.BottomAxis.LabelsSize := 2 * UsualValue

How to align the xaxis tick mark center

In the given example my first and last bar tick mark placement are not aligned centre.
Example:http://jsfiddle.net/geeet0ek/
How to make it align centre?
At this moment this is not available, because ticks are aligned to group. In your case empty value is null, so takes a place. As a result ticks is in the middle of group. You can post your suggestion in our uservoice here

Highchart Spline with inverted axis categorie text left align

I have used Spline with inverted axes, in that i need categories alignment left side.
"Is committed to advancing the future of technology" at present it is right aligned, now i need left aligned.
Please help me on this.
or example
http://www.highcharts.com/demo/area-inverted/grid
In the above link i need Monday et.. should be left aligned.
Yes, it's possible, but you will need to specify:
chart.marginLeft
xAxis.labels.x
xAxis.labels.align to left
See together: http://jsfiddle.net/fAfC4/
Note that leftMargin and x are fixed values, so it won't resize in a default way, like does by default.

How to determine/calculate where the Y axis tick marks are being plotted in CorePlot?

I'm working with CorePlot to generate a bar graph with horizontal bars (CPTXYGraph and CPTBarPlot).
There are only 10 bars being plotted at any given time, but the labels for them are arbitrarily long. As a result of that the Y axis labels rotation is set to 0.5. For the longest labels there are clipping issues with the label going outside of the left and/or bottom of the plot area.
I've fixed this in the X direction by determining the width of the longest label (as rendered in the appropriate font) and rotated the appropriate way to set the left padding in the plotAreaFrame.
Due to the rotation of the labels, if the plot at the bottom of the graph has a long name it can still extend off the bottom edge of the graph and get clipped there.
I know how tall vertically the rotated label is, but where I'm stuck is trying to determine where in the plot area the axis label is being plotted so that I can determine how much bottom padding is required.
I'm not sure if I should be trying to determine how tall the X axis label section is and then subdividing the remaining height to determine where the ticks should fall, or if there's some other better way to go about it.
The label is offset from end of the nearest tick mark by the labelOffset. The position of the end of the tick mark depends on the tickDirection, tickLabelDirection, and majorTickLength.
There are methods that allow you to convert a point from the plot space coordinate system to the view coordinate system. I've ended up solving the problem with code like the following:
// Tell the graph to lay itself out if it needs to.
[self.graph layoutIfNeeded];
// Create a point that represents 0,1 as plotted on the graph.
NSDecimal plotPoint[2];
plotPoint[CPTCoordinateX] = CPTDecimalFromInt (0);
plotPoint[CPTCoordinateY] = CPTDecimalFromInt (1);
// Convert that point from the plot coordinate system to the view coordinate system
CGPoint point = [self.graph.defaultPlotSpace plotAreaViewPointForPlotPoint: plotPoint];
// If the difference between the height of the rotated label and the position that it
// will be plotted at is at least the bottom padding, then the height is too large,
// so fix the padding.
if (labelHeight - point.y >= self.graph.plotAreaFrame.paddingBottom)
[self.graph.plotAreaFrame setPaddingBottom: (labelHeight - point.y)];
My graphs have a default bottom padding already set as a minimum, allowing this code to bump it up if there isn't enough already.

Resources