Strange effects when using a long axis in TChart - delphi

I have put a tchart on a delphi form (XE4) and make the width 65535 pixels (the maximum). I have set the scale of the bottom axis to fixed values (minimum 0, maximum 65534) and then I add values using something like:
for i := 0 to 60000 do
chart1.series[0].addXY(i, 10 + (i mod 80));
The result is some strange behaviour with additional lines being plotted on locations where they shouldn't be, while any point beyond 32767 is missing. The same thing happens when setting the maximum of the bottom axis to for example 5000 and fill the whole thing with 'only' 100 samples between 0 and 5000. Remarkable is the fact that some combinations of adding values close to the maximum value of the bottom axis do seem to work (even beyond 32767 pixels from the left).
Does anyone has some insight into the reasons of this behaviour? Is there any way to solve this problem aside from not using tcharts with a width over 32767 pixels?

TFastLineSeries is not available in TeeChart Lite for FMX, but it is in TeeChart Standard for VCL.
See the feature matrix here.
I've been able to reproduce the problem in a VCL project using a TLineSeries, so I've added it to the public tracker. In the meanwhile, if you are in VCL you can change to a TFastLineSeries.

Related

How to set the scale for bubble size in Google Sheets bubble charts

I am plotting data where all 3 piece of data for a data point are in the same units.
While the bubble size is correct relative to the other bubbles, I would really like it to scale with the horizontal axis ie for the data below, I would like the bubble to to measure about 30 units across on the x axis.
x(mm)
y(mm)
colour
bubble (mm)
Bubble 1
5
5
1
30
Bubble 2
10
5
1
20
I am pretty sure this is not a native behaviour, and I only need a rough visual match, rather than a fully accurate representation.
Does anyone have any ideas how to bodge this?
Thanks!
I have tried multiplying up the values to enlarge bubble size, but it seems that the size of the largest bubble is fixed
As I only require a visual approximation have also looked at using AppScript to create this (my coding is basic at best) but, while I can open a drawing canvas, there does not seem to be any way to automatically create a drawing from there.

Vaadin heatmap does not support 40x40 (1600) points?

In Vaadin 14.6.1, I tried to create a Vaadin heatmap foollowing the documentation / example from here.
However, I encountered a few problems/questions, listed in descending order of importance below:
The heatmap supported 30 rows by 30 columns; but when I tried 40 rows by 40 columns, the entire heatmap showed a single color (blue in my case).
Is it possible to manually set the minimum numeric value and maximum numeric value for the color scheme. This way, if I plot my data one day and it has values in the range of 0 to 1, but on another dataset from another day, the numeric values range from between 0 and 0.5, the color scheme range won't automatically change (to being between 0 and 0.5) and confuse the user.
In the documentation, it has the following methods listed, but they do not seem to exist in Vaadin 14.6.1
plotOptions.setBorderColor(SolidColor.WHITE);
plotOptions.setBorderWidth(2);
When I hover over the datapoints, is there a way that the tooltip can only show the numeric value (and not the x, y coordinate or the series name etc.?)
Is there any limit to the number of datapoints? I'm hoping that if #1 above is resolved that I can plot a 100 by 100 (ie 10,000) point heatmap.
If I plot 100by100, there will be many labels on the x and y axis. In my case, the x and y axis are actually numerical, so I did what the documentation suggested and just placed category labels in the xaxis and yaxis spots. However, is there any way to only display every "nth" label, so that the x-axis and y-axis is not so crowded? (This would essentially mimic what Vaadin does for normal line charts' xaxis and yaxis).
I'm not that experienced with Vaadin Chart, but these are the questions that I can comment on:
(1) With 40x40 items you go over the threshold of 1000 in which the Chart switches into "turbo" mode for performance reasons. This seems to not be compatible with the heatmap series. You can disable turbo mode by setting plotOptions.setTurboThreshold(0);
(2) Unfortunately the ColorAxis doesn't support this, it only has an API for min and max color. Definitely a valid use-case though, and it seems to be supported by the Highcharts library that the Vaadin Chart uses under the hood. You should consider opening a feature request for this in the Github repo.
(3) This seems to be a documentation issue. The methods are available in later Vaadin platform versions, but not in 14.6.
(5) In theory not, but in practice there will be a huge performance hit in the browser due to the excessive amount of DOM elements (quick test of 100x100 froze the browser for 10s). I'm afraid the component isn't really made for such extreme use-cases. In this case it might be better to utilize a low-level JS drawing library using the canvas, or draw an image on the server-side and display that in the browser. Maybe you can also consider modifying your use-case so that you only display one slice of your data and allow the user to switch between slices.

How to change the axis values to correctly display even when zoomed in?

I wanted to ask how to increase the values of the axis to display data correctly?
I tried searching the teechart options but with no luck.
In this case, you should either
use one more digit in the number format (0.0000) on the left axis, or
increase the distance between the labels on the left axis.
In a comment to the question, the OP confirmed that the number format should be changed.
To do this at runtime, you can do
MyChart.Axes.Left.AxisValuesFormat := '0.0000';
It is also possible to do this at design-time.
Posting a photo for others who might get confused where this setting can be tuned in teechart Options

Howto draw on every pixel, the min and max values of huge TeeChart FastLine series while DrawAllPoints:= false?

With Delphi 10.3, VCL and build-in standard TeeChart. Windows 10 x64.
I've a huge data samples, few millions, to view.
My target is to show the minimum and maximum values related to each pixel.
i.e the minimum and maximum values in a data segment which are drawn due to a screen decimation in one pixel.
Due to processing time response, I tried DrawAllPoints := false.It is x30 faster!
I think in this case, TeeChart is drawing the value of the first sample from the relevant segment.
Thus the min/max values are not drawn.
With DrawAllPoints := true, everything is fine.
I'm also allowing the user to Zoom/Unzoom.
I could define my own short TeeChart series, limited to the number of pixels myself.
However, it is not so trivial due to the user's Zoom option.
Is there any feature in TeeChart for that? i.e DrawAllPoints := false while drawing min and max of a segment on each pixel.
Maybe there is a call back routine or heritage routine I could force this behavior?
Thanks.
Set DrawAllPointsStyle property of series into daMinMax.
Seems some difference does exist.
for var i := 1 to 100000 do begin
Series1.Add(Sin(i/10000) + Random); // left one, daMinMax is set
FastLineSeries1.Add(Sin(i/10000) + Random);
end;

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:

Resources