HasDiscreteDivisions Property

Microsoft Office Web Components Visual Basic

expression.HasDiscreteDivisions

expression    Required. An expression that returns a ChSegment object.

Remarks

To illustrate the differences when setting this property to True or False, assume that you set the following properties for a segment:

  • .Begin.Value = 10
  • .Begin.Interior.Color = "White"
  • .End.Value = 50
  • .End.Interior.Color = "Green"

When setting this property to True, the Chart control would create several divisions which contain a different interpolation of the above color settings. However, points that are very close to each other in value can be formatted very differently because each point is in a different division. A point with a value of 24 may be white while a point with a value of 25 may be a fairly dark shade of green, because a division was created between 24 and 25. Setting this property to False results in a more gradual interpolation between white and green.

Example

This example binds Chartspace1 to the Order Details table in the SQL Server Northwind database. Then, a format map is created that displays the larger values in the chart with a darker shade of blue.

Sub Window_Onload()

    Dim serSeries1
    Dim segSegment1 As ChSegment
    Dim chconstants

    Set chconstants = ChartSpace1.Constants

    ' The following two lines of code bind Chartspace1 to the Order Details table in the
    ' Northwind SQL Server database.
    ChartSpace1.ConnectionString = "Provider=SQLOLEDB.1;persist Security Info=TRUE;" & _
                                   "Integrated Security=SSPI;Initial Catalog=Northwind;" & _
                                   "Data Source=DataServer;"
    ChartSpace1.DataMember = "Order Details"

    ' The following two lines of code bind Chartspace1 to the Quantity and ProductID fields
    ' in the Order Details table.
    ChartSpace1.SetData chconstants.chDimCategories, chconstants.chDataBound, "ProductID"
    ChartSpace1.SetData chconstants.chDimValues, chconstants.chDataBound, "Quantity"

    ' Create a format map.
    ChartSpace1.SetData chconstants.chDimFormatValues, chconstants.chDataBound, "Quantity"

    ' Set a variable to the first series in the first chart in Chartspace1.
    Set serSeries1 = ChartSpace1.Charts(0).SeriesCollection(0)

    ' Add a segment to the format map.
    Set segSegment1 = serSeries1.FormatMap.Segments.Add

    ' Measure the segment boundaries based upon a percentage.
    segSegment1.Begin.ValueType = chconstants.chBoundaryValuePercent
    segSegment1.End.ValueType = chconstants.chBoundaryValuePercent

    ' Set the beginning value to 0%, and the ending value to 100%.
    segSegment1.Begin.Value = 0
    segSegment1.End.Value = 1

    ' Format the interior of the matching values.
    segSegment1.Begin.Interior.Color = "White"
    segSegment1.End.Interior.Color = "Blue"

    segSegment1.HasAutoDivisions = False

    segSegment1.HasAbsoluteLabels = True

    segSegment1.HasDiscreteDivisions = False

End Sub