Main Menu
Knowledge Base
Product Registration
Log an Incident
Request a Feature
Search Incidents/Bug Reports


Search KB

Please note: In an effort to better serve you, we are in the process of restructuring DevCenter. In the process, we have moved many items that you may be used to finding in DevCenter over to the Main Site. If you are having trouble locating something, please try looking at the following places:

Knowledge Base Article: KB09972

HOWTO:Drill down in WinChart [Part 2]


The information in this article applies to:
UltraWinChart (v6.1.20061)
  Article Created: 
6/22/2006

Last Updated:
6/23/2006

Article Type
How To
  
Page Options
Average Rating:
8 out of 10

Rate this page
Print this page
E-mail this page
Add to Favorites

Summary

..Continued..

Step-By-Step Example

..Continued..

Code: Namespace Referenecs

Imports:

VB.NET

'.NET
Imports System.Data.SqlClient

'Infragistics:
Imports Infragistics.UltraChart.Shared.Events
Imports Infragistics.UltraChart.Shared.Styles

C#

//.NET
using System.Data.SqlClient;

//Infragistics:
using Infragistics.UltraChart.Shared.Events;
using Infragistics.UltraChart.Shared.Styles;

We Import the SqlClient namespace because in this sample, we will be making use of SQL Server specific classes to connect to the Database and execute commands to retrieve our data. The Infragistics UltraChart namespaces are also imported because we will be referencing several classes and enumerations as well.


Code: Class Scoped Variables

VB.NET

    'Member variables
    Private Const MAX_DRILL As Integer = 3 '1 based
    Private Const MIN_DRILL As Integer = 1 '1 based

    Private _currDrill As Integer = 1

C#

        //Member variables
        private const int MAX_DRILL = 3; //1 based
        private const int MIN_DRILL = 1; //1 based
        
        private int _currDrill = 1;

We have constants that set the minimum and maximum drill level based on an index of 1. We also have a variable that maintains the current drill level. Each time we navigate through the drill levels, this variable is the one that is updated.


Drill Down, Drill Back Logic

VB.NET

    '///
    '/// This method drills down one level
    '///

    Private Sub DrillDown()
        _currDrill += 1 'increment the current level
        'do not exceed the drill level boundaries
        If (_currDrill > MAX_DRILL) Then _currDrill = MAX_DRILL
    End Sub

    '///
    '/// this method backs up one drill level
    '///

    Private Sub DrillBack()
        _currDrill -= 1 'decrement the current level
        'do not exceed our drill boundary
        If (_currDrill < MIN_DRILL) Then _currDrill = MIN_DRILL
    End Sub

C#

        ///
        /// This method drills down one level
        ///

        private void DrillDown()
        {
            _currDrill += 1; //increment the current level
            //do not exceed the drill level boundaries
            if (_currDrill > MAX_DRILL) _currDrill = MAX_DRILL;
        }

        ///
        /// this method backs up one drill level
        ///

        private void DrillBack()
        {
            _currDrill -= 1; //decrement the current level
            //do not exceed our drill boundary
            if (_currDrill < MIN_DRILL) _currDrill = MIN_DRILL;            
        }

Drilling down and drilling back is as simple as just incrementing or decrementing our Current Drill level variable. We also check to make sure that when we do drill, we do not exceed the minimum or maximum values.

..Continued..

Related Articles

HOWTO: Drill down in WinChart [Part 4] (KB09974)

HOWTO: Drill down in WinChart [Part 6] (KB09978)

HOWTO: Drill down in WinChart [Part 5] (KB09975)

HOWTO: Drill down in WinChart [Part 3] (KB09973)

HOWTO: Drill down in WinChart [Part 1] (KB09971)

Samples

winchart_drilldown.zip
 WinChart Drilldown Samples in C# and VB.NET



How would you rate the quality of this content?
Poor -----------------------------------------> Outstanding

Tell us why you rated the content this way. (optional)