2013-07-09 42 views
0

我應該在運行時添加4個teechart控件。我能夠將這些值綁定到teechart控件。Monodroid:當我滾動視圖時,TeeCharts消失

問題是,當我滾動父視圖時,所有teecharts消失。但所有其他控件都可見(按鈕,文本視圖等)。

注意:最初所有控件都是可見的;他們只有在我滾動時纔會消失。

void drawRainfallChart() 

    { 
     try 
     { 
      obj = new csGraphClass(); 
      RainfallGraph[] graphdata = obj.getRainfallData(_cropId.ToString()); 
      if (rainfallChart == null) 
       rainfallChart = new Steema.TeeChart.TChart(this); 
      else 
      { 
       rainfallChart.RemoveAllViews(); 
       rainfallChart.Dispose(); 
       rainfallChart = new Steema.TeeChart.TChart(this); 
      } 
      if (graphdata.Length > 0) 
      { 
       rainfallChart.Aspect.View3D = false; 
       rainfallChart.Chart.Invalidate(); 
       Steema.TeeChart.Styles.Line rline = new Steema.TeeChart.Styles.Line(); 
       Steema.TeeChart.Styles.Line rCrtdayline = new Steema.TeeChart.Styles.Line(); 
       rainfallChart.Series.Add(rline); 
       rainfallChart.Series.Add(rCrtdayline); 
       DateTime currentdate = SyncProcess.CalculatedDatetime(); 
       double dc = 0; 
       foreach (RainfallGraph item in graphdata) 
       { 
        dc += Convert.ToDouble(item.yValue); 
        rline.Add(Convert.ToDateTime(item.xValue), dc); 
        if (item.xValue == currentdate.ToString("yyyy-MM-dd")) 
        { 
         rCrtdayline.Add(Convert.ToDateTime(item.xValue), 0); 
         rCrtdayline.Add(Convert.ToDateTime(item.xValue), Convert.ToDouble(item.yValue)); 
        } 
       } 
       rline.Title = "Rainfall"; 
       rCrtdayline.Title = "Crop Day"; 
       rline.Pointer.Visible = true; 
       rline.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle; 
       rline.Chart.Axes.Left.SetMinMax(0, Convert.ToDouble(dc + 5)); 
       var varMinDate = graphdata.Min(s => s.xValue); 
       var varMaxDate = graphdata.Max(s => s.xValue); 
       DateTime minDate = Convert.ToDateTime(varMinDate).AddDays(-1); 
       DateTime maxDate = Convert.ToDateTime(varMaxDate).AddDays(1); 
       rline.Chart.Axes.Bottom.SetMinMax(minDate, maxDate); 
       rainfallChart.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay); 
       rainfallChart.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yyyy"; 
       rainfallChart.Footer.Font.Size = 25; 
       rainfallChart.Legend.Font.Size = 25; 
       rainfallChart.Header.Font.Size = 25; 
       rainfallChart.Axes.Bottom.Labels.Font.Size = 18; 
       rainfallChart.Axes.Left.Labels.Font.Size = 15; 
       rainfallChart.Legend.Transparent = true; 
       rainfallChart.Header.Visible = true; 
       rainfallChart.Axes.Bottom.Grid.Visible = false; 
       rainfallChart.Header.Text = "Rain fall"; 
       rainfallChart.Legend.Visible = true; 
       rainfallChart.Axes.Left.Grid.DrawEvery = 1; 
       rainfallChart.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom; 
       rainfallChart.Panning.Allow = Steema.TeeChart.ScrollModes.None; 
       rainfallChart.Panning.Allow = Steema.TeeChart.ScrollModes.None; 
       rainfallChart.Zoom.Style = Steema.TeeChart.ZoomStyles.Classic; 
       rainfallChart.Zoom.Allow = false; 
       rainfallChart.Panning.Allow = ScrollModes.None; 
       rainfallChart.SetPadding(0, 50, 0, 50); 
       Android.Widget.LinearLayout.LayoutParams layoutParams = new Android.Widget.LinearLayout.LayoutParams(graphheight, graphwidth); 
       layoutParams.TopMargin = 100; 
       layoutParams.BottomMargin = 100; 
       rainfallChart.ScrollBarStyle = ScrollbarStyles.InsideOverlay; 
       rainfallChart.SetScrollContainer(false); 
       srcgraph.AddView(rainfallChart, layoutParams); 
      } 
     } 
     catch (Exception ex) 
     { 
      ErrorHandling.ErrorEntry(ex.Message.ToString(), "TodayGraphViewController - drawRainfallChart"); 
     } 
    } 

回答

1

另一位用戶最近報道了類似的問題(TM63016590)時Zoom.Style設置爲ZoomStyles.Classic。我們對此有一個修復建議,可在https://www.steema.com/downloads/net_android的當前評估版中找到。您能否讓我們知道它是否能解決您的問題?

+0

請檢查上面的代碼..其已經存在。 rainfallChart.Zoom.Style = Steema.TeeChart.ZoomStyles.Classic; – user2330792

+0

@ user2330792是的,所以我看到了。這就是爲什麼我建議使用測試版固定TM63016590。如果您向我們發送一個簡單的示例項目,我們可以「按原樣」運行以重現此問題,但我很樂意測試問題是否得到解決。您可以在www.steema.net/upload/上發佈您的文件。或者,您可以嘗試使用其他ZoomStyles選項。 –

+0

我嘗試了所有其他選項。沒有工作。我得到鏈接http://www.steema.net/upload/的配置錯誤。我如何向你發送示例代碼。請給我你的電子郵件ID。 – user2330792

相關問題