How to fix TChart Axis Margin Delphi - delphi

I was a dynamic data, and I want to show it on the same TChart. How can I fix the axis margin with different data?
For Example:
First Data Have a 'thousand' value
Second Data Have a 'hundred' value
I want my TChart have same margin for any value. Thanks in advance

I think you can set it by forcing the label width to a given value.
TChart1.Axis.Left.Labels.Size := 30;
So that it always stay at the same width.
With the interface it's here

Related

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

Delphi TChart Bar Offsets

By default, the biggest value in the chart will have a full bar from bottom to top.
Is there a way to get some space between the top of the diagram and the maximum value? I wanted to have a standard zoom of 90% or something like this, but zooming out any further is not possible.
Yes, this is possible using axis MaximumOffset property. For example:
Chart1.Axes.Left.MaximumOffset:=25;
As #Narcis Calvet sad one option is to use MaximumOffset but another option is to use:
Chart1.Axes.Left.Increment := 20;
I prefer to use Increments instead of MaximumOffset becouse usually it reults in nicer numerical scale on the side.
EDIT: To learn more about controlling the TChart Axis controll check this site:
http://wiki.teechart.net/index.php?title=VCLTutorial4

Highcharts gauge fill to 100% of container

This functionality is available for the Pie Chart via the plotOptions size parameter, however after inspecting the Highcharts API the size isn't available for the Gauge.
size API entry for Pie Chart
Considering the likeness of the two charts (being circular), I was hoping there would be a similar option but the gauge always fills some subset of the container div that I am unable to control. Has anyone else run into this issue or found a solution?
By setting the spacing to zero, you can fill the entire space:
http://jsfiddle.net/mkremer90/3sngK/1/
Fiddle with the spacing parameters to change how much the chart fills. As for a percentage based like size option I can't find one either.
I know this is old, but if like me, you have borderWidth set to something greater than 0, you'll find yourself with the tag being positioned (e.g. x="5.5" y="5.5") off from the corner and width and height shrunk. Setting spacing and margin options won't help in this case.
The simple solution then is to avoid setting borderWidth to anything at all; just leave it default or set it to zero. Instead, set the border on the container element you're calling highcharts on.
Alternatively, you could set negative margins and increase size on the container element to compensate for position shift and size shrink on the graph. Might need to wrap the container in a div with style="overflow: hidden;".

TeeChart VCL chart scale issue

I have an issue using Delphi 2007 & TChart 7.0.10.0 or 7.0.11.0 or the latest evaluation 9.0.5.0 on the TChart scaling.
The problem arises as soon I enlarge the window after a certain width and KEEP the Form height!
This is the drawing using a smaller form size.
now if I enlarge to 1200 weight I get this ugly scaling:
If I export in the designer without the aspect ratio set and with 1200 weight you will se this:
How to get ride of this?
Hp
I see you've set top and bottom margins to Chart1 in your project (8 and 20 percent respectively). I guess this has the intention of giving more space (in height) for Chart2 when you resize the form making it bigger.
Chart1's Top and Height properties should be set according to fill this blank space in the Form's OnResize event.
Try this:
procedure TGSSkillgroupStatisticForm.FormResize(Sender: TObject);
begin
Chart1.Draw;
Chart2.Top:=Chart1.ChartRect.Bottom + 25;
Chart2.Height:=Chart1.Height-Chart1.ChartRect.Bottom-40;
end;
Steema Support Central
Keep in mind that I only scale in the x-axis. Your 3-D bar / construct will after a certain width, overlap the scaling numbers! Your given answer do not fix this issue at all. To see the real problem in a better way, I added on the form creation:
Chart2.BottomAxis.Maximum := 20;
Series2.AddBar(12, 'Hallo', clred);
Here the result:

How do I make a TCheckListBox scroll vertically?

I've got a TCheckListBox on a form. Its Columns property is set to 2, and if there are more items than can fit on-screen in two columns, it puts a horizontal scrollbar across the bottom of the control.
Thing is, the way this form it laid out, it would be much more convenient to scroll vertically. But I can't seem to figure out how to make the box do that. I thought setting Columns to 1 should work, but it doesn't.
Anyone know how to make a TCheckListBox scroll vertically instead of horizontally?
You need to set Columns to 0.
For all positive values the VCL sends a LB_SETCOLUMNWIDTH message to the underlying native list box control, with the width parameter set to the list box client width divided by the number of columns. Items that don't fit will start a new column with the same column width, so the horizontal scrollbar becomes visible.
If Columns is 0 then there is a single column that spans the entire client width of the list box, and items that don't fit will make the vertical scrollbar visible, and hide the horizontal scrollbar.
Edit:
There seems to be genuine interest what happens when a negative value is used for the Columns property.
The method TCustomListBox.CreateParams() sets the LBS_MULTICOLUMN list box style depending on the Columns property being different from 0. For negative values the style flag is set, but the VCL doesn't send the LB_SETCOLUMNWIDTH message, so the native control uses the default column width. It is documented to be:
15 times the average character width for the font used by the list box.
(Search for "The LBS_MULTICOLUMN style specifies" to find the relevant passage of text.)

Resources