'宣言 Public ReadOnly Property Drill As DrillDownAppearance
public DrillDownAppearance Drill {get;}
このプロパティは、Infragistics.UltraChart.Resources.Appearance.DrillDownAppearance を UltraWebChart コントロールに提供します。これにより、開発者はランタイムに UltraWebChart のドリルダウン動作に関連する各プロパティを設定できます (デザインタイムでのドリルダウン階層の定義はサポートされていません)。
' initialize DrillElement UltraChart1.Drill.Enabled = True UltraChart1.Drill.DrillElements = New DrillElement() {New DrillElement} UltraChart1.Drill.DrillElements(0).DrillDown = New MyDrillDown(UltraChart1) ' ... Private Sub UltraChart1_ChartDataClicked(ByVal sender As Object, ByVal e As Infragistics.UltraChart.Shared.Events.ChartDataEventArgs) Handles UltraChart1.ChartDataClicked Dim childTable As DataTable = chartData.Tables("Child") UltraChart1.Drill.DrillElements(0).DrillDown.Drill(e.DataRow, e.DataColumn, ChartType.LineChart, childTable) End Sub ' ... Friend Class MyDrillDown Implements IDrillDown Private myChart As UltraChart Public Sub New(ByVal chart As UltraChart) myChart = chart End Sub Public Sub Drill(ByVal row As Integer, ByVal column As Integer, ByVal chartType As Infragistics.UltraChart.Shared.Styles.ChartType, ByVal dataSource As Object) Implements Infragistics.UltraChart.Resources.IDrillDown.Drill ' implement Drill-Down behavior / initialize child chart myChart.ChartType = chartType myChart.Drill.Enabled = False myChart.Data.DataSource = dataSource myChart.Data.IncludeColumn(0, False) myChart.Data.IncludeColumn(1, False) myChart.Data.DataBind() End Sub End Class
// initialize a DrillElement UltraChart1.Drill.Enabled = true; UltraChart1.Drill.DrillElements = new DrillElement[] {new DrillElement()}; UltraChart1.Drill.DrillElements[0].DrillDown = new MyDrillDown(UltraChart1); // ... private void UltraChart1_ChartDataClicked(object sender, ChartDataEventArgs e) { // initiate custom Drill-Down DataTable childTable = chartData.Tables["Child"]; UltraChart1.Drill.DrillElements[0].DrillDown.Drill(e.DataRow, e.DataColumn, ChartType.LineChart, childTable); } // ... internal class MyDrillDown : IDrillDown { private UltraChart myChart; public MyDrillDown(UltraChart chart) { myChart = chart; } #region IDrillDown Members void Infragistics.UltraChart.Resources.IDrillDown.Drill(int row, int column, Infragistics.UltraChart.Shared.Styles.ChartType chartType, object dataSource) { // implement Drill-Down behavior / initialize child chart myChart.ChartType = chartType; myChart.Drill.Enabled = false; myChart.Data.DataSource = dataSource; myChart.Data.IncludeColumn(0, false); myChart.Data.IncludeColumn(1, false); myChart.Data.DataBind(); } #endregion }