翻譯|使用教程|編輯:莫成敏|2019-07-12 14:20:24.217|閱讀 342 次
概述:這篇文章主要介紹甘特圖以下的甘特圖——一個表單顯示兩個VARCHART XGantt實體,現在就來看看怎么操作吧!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
VARCHART XGantt是一個交互式的甘特圖控件,其模塊化的設計讓您可以創建滿足您和您的客戶所需求的應用程序。VARCHART XGantt可以快速、簡單地集成到您的應用程序中,幫助您識別性能瓶頸、避免延遲以及高效利用資源,使復雜數據變得更加容易理解。
這篇文章主要介紹甘特圖以下的甘特圖——一個表單顯示兩個VARCHART XGantt實體,現在就來看看怎么具體操作吧!
如果要在一個表單上顯示兩個XGantt實體,則應使用SplitContainer。 SplitContainer是一個由兩個面板組成的控件,兩個面板之間的比例可以在運行時通過拆分器進行交互式修改。例如,如果許多計劃外任務一個接一個顯示,那么使用拆分器是有意義的。
vcGantt1
如果XGantt的兩個實體安裝在SplitContainer的兩個面板上,則可以交互修改實體的寬高比。
vcGantt2
要創建整潔的圖片,兩個XGantts的表格寬度和時間刻度的設置應該相同。此外,您應該禁用上方圖表的水平滾動條和下方圖表的時間刻度(vcGantt1為上方圖表,vcGantt2為下方圖表),以便有更多空間來顯示數據。由于上方圖表的水平滾動不再可能,為了保證下方圖表滾動的同時滾動上方圖表,您需要以下代碼 :
private void vcGantt2_VcDiagramHorizontalScrolled(object sender, VcDiagramHorizontalScrolledEventArgs e) { vcGantt1.FitRangeIntoView(e.CurStartDate, e.CurEndDate, 0); } The interactive modification of the time scale solution (unit width) in the upper chart requires a reaction as well (if this interaction has not been disabled in general): private void vcGantt1_VcTimeScaleSectionRescaling(object sender, VcTimeScaleSectionRescalingEventArgs e) { DateTime leftDate = new DateTime(1,1,1); DateTime rightDate = new DateTime(1,1,1); int minBasicUnitWidth = 75; //May have to be adjusted if (e.NewBasicUnitWidth < 75); { e.TimeScale.get_Section((short)e.SectionIndex).UnitWidth = minBasicUnitWidth; vcGantt2.TimeScaleCollection.Active.get_Section((short)e.SectionIndex).UnitWidth = minBasicUnitWidth; e.ReturnStatus = VcReturnStatus.vcRetStatFalse; } else vcGantt2.TimeScaleCollection.Active.get_Section((short)e.SectionIndex).UnitWidth = e.NewBasicUnitWidth; vcGantt1.GetCurrentViewDates(ref leftDate, ref rightDate); .ScrollToDate(leftDate, VcHorizontalAlignment.vcLeftAligned, 0); } The following code is needed to respond to the interactive moving of the splitter between the table and the diagram of the two charts: private void vcGantt1_VcTableWidthChanging(object sender, VcTableWidthChangingEventArgs e) { vcGantt2.LeftTableDiagramWidthRatio = (short)e.TableDiagramWidthRatio; } private void vcGantt2_VcTableWidthChanging(object sender, VcTableWidthChangingEventArgs e) { vcGantt1.LeftTableDiagramWidthRatio = (short)e.TableDiagramWidthRatio; }
具體操作看完了,希望對您有幫助~
想要購買VARCHART XGantt正版授權,或想獲取更多產品信息的朋友請點擊
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn