2012-03-30 43 views
0

我正在評估Teechart 4.1.2012.2287,並且我有矩形工具的問題。 我的項目是用VS.Net和framework 4.0編寫的。Tchart矩形工具

如果您放置一個矩形工具,並將位置單位設置爲百分比(我需要這樣做,以便矩形在調整圖表大小時保持大致相同的位置),抓握手不會顯示鼠標指針在矩形上方。它確實錯誤地顯示在相應的像素位置而不是百分比位置。

這是一個錯誤還是我做錯了什麼?

回答

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; 
} 
+1

調查它遠一點,我發現這其實是兩個不同的問題,所以我將它分成兩部分(TF02016131和TF02016132)。 TF02016131是當PositionUnits = Percent時,單擊的函數不成立。我剛剛修復了它,所以下一個維護版本應該在正確的位置顯示拖動/調整大小的鼠標光標樣式。 TF02016132是關於百分比和像素之間的內部轉換,以便進行拖放和調整大小。我已經部分糾正了它。 – Yeray 2012-04-02 09:58:49

+0

何時發佈下一個維護版本? – Ross 2012-04-02 10:21:37

+0

@Ross尚未建立日期。我們嘗試每兩個月大約有一個版本。鑑於目前的版本是在一個月前發佈的,我們希望在接下來的一個月內準備好下一次維護版本。請繼續關注Steema Software的溝通渠道。 – 2012-04-02 10:40:44