Teechart with Candlestick for Delphi - delphi

I am using the TeeChart VCL Delphi module. I am trying to plot a candlestick chart. I have the following questions:
When I run the code it shows me the last date data on the right hand side. However, the y-axis is not automatically scaling at all. If I scroll backwards, it automatically adjust the y-axis scales. However, if I go far to the right which is the end, it does not auto-scale the y-axis anymore. What am I doing wrong?
The x-axis is the days of the week. However, I have no data for the weekend. It shows as empty space. How do I remove that?
How do you change the cursor so it shows the date/time for the X,Y you choose?

When I run the code it shows me the last date data on the right hand
side. However, the y-axis is not automatically scaling at all. If I
scroll backwards, it automatically adjust the y-axis scales. However,
if I go far to the right which is the end, it does not auto-scale the
y-axis anymore. What am I doing wrong?
What about setting the Y axis (left axis) to be automatic? For example:
Chart1.Axes.Left.Automatic:=True;
A more drastic solution would be also forcing the chart to repaint after adding each point.
Series1.Add(value);
Chart1.Draw;
If any of that helps please send us a simple example project we can run "as-is" to reproduce the problem here. You can attach your files here.
The x-axis is the days of the week. However, I have no data for the
weekend. It shows as empty space. How do I remove that?
You should do as in the All Features\Welcome!\Chart Styles\Financial\Candle (OHLC)\Axis Labels no Weekends example in the new features demo. This demo is included with registered and evaluation versions. Otherwise you can download it here.
How do you change the cursor so it shows the date/time for the X,Y you
choose?
There are two examples in the demo that can help you on this:
All Features\Welcome!\Tools\Annotation\Annotation Callout
All Features\Welcome!\Tools\Cursor\Synchronizing Two

Related

Possible bug in zooming in on Vaadin charts when more than 1 series present?

Earlier, I asked how to create "spectra" charts in Vaadin (see How to create a "spectrum" chart using Vaadin 14+). It turned out that one didn't actually need to create barcharts -- the only real need seemed to be to set the pointwidth to 1. (This solved the "very wide" widths lines when zooming.)
HOWEVER: I think there's a bug in vaadin charts when one has more than 1 series presents and when one zooms: the line moves to an inccorrect position on the x-axis (or the x-axis is no longer placed correctly.) Any thoughts on how to resolve? Here are two screenshots showing the problem. In the first one, only ONE series is visible and the line is at the correct x-axis point of ~598.36. In the second screenshot, though, (where the only change I have made is to enable the 2nd series), the line moves to an INCORRECT x-axis coordinate (it seems like it's ~598.25!!!).
One theory I have is that adding the second series somehow confuses the chart from determining the correct x-axes....maybe because each series has it's own x axis logic in some way? Not sure....(I'm using Vaadin 14 and I tested this both in my dev env and on production.)

TeeChart 2017: FastLine AddRealTime auto scales bottom axis despite settings

The TeeChart component has a chart series called IFastLineSeries.
It allows drawing simple "line type" charts.
Its interface provides a method called AddRealTime which is a faster way to add data to the chart than the more generic AddXY method.
But AddRealTime has a few undocumented side effects:
It scrolls the chart to the left when the data almost "overflows" the view (to make room for new data)
It can adjust the bottom axis (X-axis range) to fit all data when doing so
The first feature is reasonable behavior in a lot of cases: for instance you want to keep showing the most recent process measurements as they are coming in.
However, in my case the automatic scaling for the bottom (X-axis) has been turned off. IMO it shouldn't touch the scaling settings then! But it does.
The second feature is worse: after auto scrolling, the control ensures that all the information is in view. This can slow down the application, because you may have accumulated lots of data in the fast line series which all has to be rendered then... Defeats the "is faster" philosophy behind the method...
I'm okay with the scrolling, but not with the automatic 'zoom out X' action.
Has anyone managed to get AddRealTime working without that, or is there no other choice than to fall back to the slower AddXY function?
I know I have to adjust the bottom axis myself then to achieve a similar scrolling effect, but at least it would not zoom out unexpectedly.
Remarks:
Steema software seems to know about this problem, ticket TA05011024.
Their support forums list similar if not the same problems:
How to disable autoscale with fastline series
FastLine AddRealTime ignores axis limits
You can control the behaviour you describe in the following way:
You could use Series.AddXY to avoid any of the AddRealtime's automatic behaviour; but you can anyway too, continue to use AddRealtime and modify the behaviour using your own SetMinMax of the Axis to scroll data off to the left, that way maintaining the same number of display points in the chart.
The demo here does just that and addresses your question.
Github VB TeeChart Add Realtime demo project

What TeeChart Tool can I use to Interactively select points from a FastLine Graph

While using Delphi Seattle 10 and Steema TeeChart Pro VCL FMX 2016.18, I am looking to Highlight a Selection of a Line Graph (multiple series) in the way that Zooming allows / makes a square around a highlighted selection of a Line Graph to indicate which part of it to zoom into (as long as the onmousedown action is in progress).
The purpose of this would be to allow the selection to remain highlighted while the mouse is no longer being clicked, to potentially "Delete" the highlighted Data points. All I need this for is to obtain the (X0 Y0 X1 Y1) values to possibly obtain the CalcPosPoint(X) and remove all the points inside. The data is currently obtained through a Record Struct (Memory Mapped) file, and it will there for be used to set/check for a property "deleted" to indicate on the next redraw of the graph which rows to completely ignore and which to continue printing.
I hope to be able to do this (select from 1 chart), and have it simultaneously draw on multiple graphs. I have tried to look for an example of this feature through the use of TSelectorTool (FMXTee). One of the pages I found referring to such a tool is Interactive data point selection as well as Multiple selections with Selector Tool
And my second question has to do with TeeCharts directly. Where would I find fmx240.bpl as TeeChart_Pro_Firemonkey_Demo.exe requires this file in order to run? I did manage to copy vcl240.bpl from "Embarcadero\Studio\18.0\bin" and put it into "Embarcadero\Studio\17.0\bin"
[Edited]
I have managed to capture / create a sample code (MVCE) from which I can now select a portion and create a square around a particular sample of graph lines.
The control graph right now is the bottom graph (Chart5). If anyone is interested in seeing the code, I have put up a pastebin sample.
PasteBin Sample Code
And a TeeCharts.tar.gz is accessible to anyone who wishes to see a sample of the code, as well as the data sample.
filetolink.com Source Files
I no longer feel the need for mathematical equation to differentiate the top graphs from the bottom (because the bottom axes are automatic where as the top are defined). I intend to only use the space which is adherent to the visible space, and do not intend to extend in either direction (left or right). That means at this point the size of the graph does not matter, because once I over populate the charts above, the position in the bottom graph would become irrelevant, and therefor I do not intend to use the bottom chart.
The next step is to save the positions of the boxes so that they can reappear when the graph is shift from left (past data) to the right (live data). And then uses the buttons above to make the appropriate action to the graphs.
I would like to know what way would be the most sufficient way to record the positions of the rectangles, so when the chart is shifted (via the ScrollBar1), the rectangles are moving with the direction of the scrollbar. But I'm sure I can achieve that.
I think I have found a solution. The red squares are only prevalent for the visual aspect, they can be drawn on, I don't need to do anything special with each chart, as I already know what the X0..Y1 parameters are, they are known from the initial chart. The problem h/e has to do with the initial chart. As long as the screens are all full, I can zoom in correctly w/ alignment with on all the charts (ZoomRect/Rectf(X0..Y1))
But what kind of equation would it take to adjust the charts that are not in the same zoom / max / min when the Chart5.Axes.Bottom.Automatic = True?
From there I just simply have to disable the immediate zoom feature, and allow buttons to become functional, to decide what the next course of action would be.

Highcharts highstocks - candlestick graph has last value partially cut

In a candlestick graph i am building, the latest bar is cut-off partially such that even the bar is not visible. Thus it's difficult to judge the high and low by seeing the bar.
I'm unable to post a pic now but it's like the last rectangle being cut in half.
I'm tried a lot of options in the api but can't figure out why this is not showing correctly. The chart margin and axis offset options havent' helped. Is there a way i can set the series margin from the plot area so that it displays right.
For this problem, the best solution is to insert a dummy series which should be hidden from every aspect of the chart. So try this, insert a dummy series from the last point of the data series to some extra buffer(as per need). Then remove this series from the chart by explicitly removing it from the legends (using showinlegend),chart(setting linewidth to 0) and from tooltip by having a check in formatter. Hope this solves your problem.
I had the same problem and couldn't figure it out, because no matter how I changed the xAxis.maxPadding or changed the xAxis.max, it would always cut off the last candlestick when I clicked on the range selector.
To solve it, (hack) I just added an extra data point in my series and set it 1 day past the last day and set all values to null.
Without any code or a pic, it's hard to tell the problem, but it sounds like you need to use the max padding option. http://api.highcharts.com/highcharts#xAxis.maxPadding. You may also want to look at endOnTick as well as whether you are setting max on the axis.

Highcharts stacked area filtering

I'm getting a bug in my stacked area implementation when a user filters to a specific line.
In the image linked below, you'll see we're tracking two trends. When I turn off the "Dialup" trend, the orange area should remain where it is. Instead, it moves up to fill the entire area. Likewise, if I were to turn off the orange "Broadband" trend, the green dialup area fills the entire area below it, rather than falling to the baseline as it should.
(stackoverflow will not allow me to post images yet.)
You can see the value in the tooltip remains accurate.
Could anyone provide some insight into what may be causing this? In case this may be a factor, the chart is generated based on a table of data using Highcharts.visualize().
I can see that you're using Highcharts 3.0.0. According to this, there was a bug in this version of Highcharts. If you upgrade Highcharts to the latest version, it should work as intended.

Resources