Radar Chart in VB6.0

Posted on 2006-05-25
Last Modified: 2013-12-25
I have mschart.ocx and mschart20.ocx (from what I can tell they are the same), I need to display a Radar Chart but none of these controls has it. I have surf the net and experts-exchange site and all comments indicates that this type of chart is included in this controls, how can I display a Radar Chart in Visual Basic?

Question by:luis_s_urraza
    LVL 76

    Expert Comment

    The mschart20 on my system does not have a Radar Chart type.
    If you want to display a Radar Chart, you can insert an OLE container control on your form and choose a Chart/Graph Object. I have Microsoft Excel Chart and Microsoft Graph 2000 Chart on my system. If you right-click on the graph that is inserted while in Edit Mode, you get a Chart Type... item on the Popup where you can choose 'Radar'.

    Author Comment

    Thank you Graham, sorry for the late response. Do you have an example on how to change the values of this graph?

    LVL 76

    Accepted Solution

    I set a reference to the Microsoft Graph Object library and modified an example from MS until it worked, that is to say, ran without error. It may not make much sense as a chart, but it should get you started.

    Option Explicit

    Private Sub Command1_Click()
    Dim oGraphChart As Graph.Chart
    Set oGraphChart = OLE1.object
       With oGraphChart
           'Format the embedded chart.
           .ChartArea.Font.Size = 8
           .ChartType = xlRadar
           .HasTitle = True
           .ChartTitle.Text = "Sales per Product"
           .ChartTitle.Font.Size = 12
           '.Axes(xlValue).HasTitle = True
           '.Axes(xlValue).AxisTitle.Caption = "Dollars ($)"
           .ChartArea.AutoScaleFont = False
           'Add data for the chart to the DataSheet in MSGraph.
           With .Application.DataSheet


               'Add the chart row labels.
               .Cells(2, 1).Value = "Widgets"
               .Cells(3, 1).Value = "Gadgets"
               .Cells(4, 1).Value = "Gizmos"

               'Add the chart column labels.
               .Cells(1, 2).Value = "1999"
               .Cells(1, 3).Value = "2000"

               'Add data to the chart.
               Dim r As Integer, c As Integer
               For r = 2 To 4
                   For c = 2 To 3
                       .Cells(r, c).Value = Rnd() * 100000

           End With
           .Application.Update 'Update the changes
           .Application.Quit   'and deactivate the chart.
       End With

    End Sub


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now