1
.NET Winform 버전 teechart 4.1.2012.1032를 사용합니다.축소 샘플링 차트 확대
내가 제공 한 샘플을 수정했습니다. "Extended \ 포인트 감소 \ DownSampling 추가" 그러나 챠트를 확대 할 때, 쇄선 마크 수는 100이 아닙니다. downSampling.DisplayedPointCount. 어떻게 해결할 수 있습니까?
private void InitializeChart()
{
this.cursorTool1 = new Steema.TeeChart.Tools.CursorTool();//
this.tChart1.Tools.Add(this.cursorTool1);//
this.cursorTool1.FollowMouse = true;//
this.cursorTool1.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical;//
this.cursorTool1.Change += new Steema.TeeChart.Tools.CursorChangeEventHandler(this.cursorTool1_Change);//
CreateArrays();
tChart1.Aspect.View3D = false;
tChart1.Zoom.Direction = ZoomDirections.Both;//.Horizontal;//
tChart1.Series.Add(points = new Steema.TeeChart.Styles.Points());
tChart1.Series.Add(fastLine = new Steema.TeeChart.Styles.FastLine());
downSampling = new Steema.TeeChart.Functions.DownSampling(tChart1.Chart);
points.Add(xValues, yValues);
points.Active = false;
downSampling.DisplayedPointCount = 100;
downSampling.Method = Steema.TeeChart.Functions.DownSamplingMethod.MinMaxFirstLast;// Null;
fastLine.TreatNulls = Steema.TeeChart.Styles.TreatNullsStyle.DoNotPaint;
fastLine.DataSource = points;
fastLine.Function = downSampling;
this.tChart1.Axes.Custom.Add(new Steema.TeeChart.Axis(this.tChart1.Chart));//
this.tChart1[1].CustomVertAxis = this.tChart1.Axes.Custom[0];//
this.tChart1[0].CustomVertAxis = this.tChart1.Axes.Custom[0];//
this.fastLine.Marks.Visible = true;//
}
private void CreateArrays()
{
int length = 2600000;
xValues = new Nullable<double>[length];
yValues = new Nullable<double>[length];
Random rnd = new Random();
for (int i = 0; i < length; i++)
{
xValues[i] = i;
yValues[i] = i;
}
}
private void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1[1].CheckDataSource(); //series 1 is the function series
}
나는 DisplayedPointCount의 의미를 알고 있습니다. DisplayedPointCount를 100으로 설정하면 100 점이 그려집니다. 그러나 확대 할 때, 값 수 100은 Axes.Bottom.Modimum과 Maximum 사이에서 다시 그려야한다고 생각합니다. 그러나 결과는 그렇지 않았습니다. 어떻게 해결할 수 있습니까? 이 버그인가? 이 케이스에 대한 샘플 코드를 보여주세요 (다운 샘플링 기능의 경우 확대/축소). 고맙습니다. –
@DugSungKim 자신을 명확하게 설명하지 못했지만, 두려웠습니다. DisplayedPointCount는 표시 될 최대 점 수이지만이 값에 도달한다는 것을 의미하지는 않습니다. 어쨌든, 방금 솔루션 제안으로 내 대답을 업데이트했습니다. –
답변 해 주셔서 감사합니다. 그러나 points1.Active가 false이면 코드에 올바르게 표시되지 않습니다. 필자의 경우, Points1.Active는 false 여야합니다. 그렇지 않으면 많은 데이터가 표시되고 차트 성능이 좋지 않을 수 있기 때문입니다. 다른 해결책이 있습니까? –