Contact Sales

Call center available M-F 9:00 - 4:00 US Eastern Time.

Case Studies

Colasoft

Colasoft selected Xtreme Toolkit Professional with Visual C++ over many...

Secondary Axis Charts

Secondary axis are useful when you need to display a series of data that values the greatly differ from each other or you might use a secondary axis when displaying two series of data with different data type (i.e. price and quantity). In both of these cases you can plot each of the series on a secondary axis so that they can both be seen in the same view. Displaying both the secondary x and y axis can be useful if making a scatter chart.

// Sample Code
'This sample shows how to display a secondary axis for a series in a 2D diagram

    ChartControl.Content.Legend.Visible = True
    
    Dim Series1 As ChartSeries, Series2 As ChartSeries
    Set Series1 = ChartControl.Content.Series.Add("Series 1")
    
    Series1.Points.Add "A", 1200
    Series1.Points.Add "B", 700
    Series1.Points.Add "C", 500
    Series1.Points.Add "D", 400
    Series1.Points.Add "E", 300
    Series1.Points.Add "F", 200
    Series1.Points.Add "G", 150

    
    Dim Style As ChartLineSeriesStyle
    Set Style = New ChartLineSeriesStyle
    Series1.Style = Style
    Style.Marker.Type = xtpChartMarkerTriangle
    Style.Marker.Size = 16

    Set Series2 = ChartControl.Content.Series.Add("Series 2")
    Series2.Points.Add "A", 50
    Series2.Points.Add "B", 40
    Series2.Points.Add "C", 30
    Series2.Points.Add "D", 20
    Series2.Points.Add "E", 15
    
    Set Style = New ChartLineSeriesStyle
    Series2.Style = Style
    Style.Marker.Type = xtpChartMarkerStar
    Style.Marker.Size = 16
    
    Dim Diagram As ChartDiagram2D
    Set Diagram = ChartControl.Content.Diagrams(0)
    
    Diagram.AxisX.Title.Text = "Series 1 (Primary Axis X)"
    Diagram.AxisX.Title.Visible = True
    Diagram.SecondaryAxisX.Title.Text = "Series 2 (Secondary Axis X)"
    Diagram.SecondaryAxisX.Title.Visible = True
    Diagram.SecondaryAxisX.Visible = True
    ChartControl.Content.Series(1).Style.SecondaryAxisX = True
    
    Diagram.AxisY.Title.Text = "Series 1 (Primary Axis Y)"
    Diagram.AxisY.Title.Visible = True
    Diagram.SecondaryAxisY.Title.Text = "Series 2 (Secondary Axis Y)"
    Diagram.SecondaryAxisY.Title.Visible = True
    Diagram.SecondaryAxisY.Visible = True
    ChartControl.Content.Series(1).Style.SecondaryAxisY = True
// Sample C# Code