开发者

TCHart - get number of points I have added to a series

开发者 https://www.devze.com 2023-02-01 00:00 出处:网络
I am using Chart1.Series[0].AddXY() to add points to a chart. Sine I will add each new point one X-axis pixel after the last, I thought I could use something likeChart1.Series[0].AddXY(Chart1.Series[

I am using Chart1.Series[0].AddXY() to add points to a chart.

Sine I will add each new point one X-axis pixel after the last, I thought I could use something like Chart1.Series[0].AddXY(Chart1.Series[0].NumSampleValues, codValue, '', clRed ); but, for some reason, Chart1.Series[0].NumSampleValues always evaluates to 26.

I guess I am using the wr开发者_如何学Cong property. Which should I be using?


I think you should not use NumSampleValues

If you want to add at the last (provided that you are incrementing X-axis by 1) you can use Series1.XValues.Count;


What about TChartSeries.Count?

TChartSeries.Count TChartSeries

function Count: Integer;

Unit TeEngine

Description This function returns the number of points in the Series.

And just for completeness: This is what NumSampleValues does:

Each Series draws random values at design mode unless you connect the Series component to other Series component or to a DataSet (Table,SQL,TClientDataset) component.

This virtual function returns the predefined number of random values each Series draws.

0

精彩评论

暂无评论...
验证码 换一张
取 消