0

Teechart 4.1.2012.2287を評価していますが、長方形ツールに問題があります。私のプロジェクトは、VB.Netとフレームワーク4.0を使用してVS2010で記述されています。

長方形ツールを配置し、位置の単位をパーセントに設定した場合(チャートのサイズを変更したときに長方形がほぼ同じ位置に留まるようにする必要があります)、マウスポインターが長方形の上にある場合、グラブハンドは表示されません。 。実際には、パーセンテージの位置ではなく、対応するピクセルの位置に誤って表示されます。

これはバグですか、それとも私は何か間違ったことをしていますか?

4

1 に答える 1

0

以下のコード スニペットを使用して問題を再現することができ、調査対象の欠陥リストに (TF02016130) を追加しました。

  tChart1.Aspect.View3D = false;
  tChart1.Dock = DockStyle.Fill;

  tChart1.Series.Add(new Steema.TeeChart.Styles.Points()).FillSampleValues();

  Steema.TeeChart.Tools.RectangleTool rectangle1 = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);

  rectangle1.Text = "My rectangle tool";
  rectangle1.AutoSize = true;
  rectangle1.PositionUnits = Steema.TeeChart.PositionUnits.Percent;
  rectangle1.Shape.CustomPosition = true;
  rectangle1.Shape.Left = 50;
  rectangle1.Shape.Top = 50;
  rectangle1.AllowDrag = true;
  rectangle1.AllowResize = true;
  rectangle1.AllowEdit = true;

当面の回避策は、次に示すように、AfterDrawイベントとピクセルの配置を使用することです。

public Form1()
{
  InitializeComponent();
  InitializeChart();
}

private Steema.TeeChart.Tools.RectangleTool rectangle1;

private void InitializeChart()
{
  tChart1.Aspect.View3D = false;
  tChart1.Dock = DockStyle.Fill;

  tChart1.Series.Add(new Steema.TeeChart.Styles.Points()).FillSampleValues();

  rectangle1 = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);

  tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);

  rectangle1.Text = "My rectangle tool";
  rectangle1.AutoSize = true;
  rectangle1.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
  rectangle1.AllowDrag = true;
  rectangle1.AllowResize = true;
  rectangle1.AllowEdit = true;

  tChart1.Draw();
}

void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
  rectangle1.Shape.CustomPosition = true;
  rectangle1.Shape.Left = tChart1.Width / 2;
  rectangle1.Shape.Top = tChart1.Height / 2;
}
于 2012-04-02T09:13:10.973 に答える