CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    2

    Question VB 6.0 Mshart Control Problem

    when using Me.MSChart1.ChartData = aDsply() (the array contains the rowlabels and the data and is a (17,2) array) the chart plots with either an extra column (R1) when I use the 1-17 loop or an extra column R18 when I use a 0-16 loop.
    If I use the following section the data does not display: Anyone have an idea????
    With MSChart1
    col = 1
    .chartType = VtChChartType2dBar
    .ColumnCount = 1
    .RowCount = 17
    For row = 1 To .RowCount
    .DataGrid.SetData row, col, arrBar(row), dataflag
    Next row
    With .DataGrid
    .ColumnLabelCount = 1
    .ColumnLabel(1, 1) = "Reported Concerns"
    .RowLabelCount = 1
    For ctr = 1 To 17
    .RowLabel(ctr, 1) = aColLabel(ctr)
    Next ctr
    End With
    .ShowLegend = True
    End With

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: VB 6.0 Mshart Control Problem

    I have this quick sample:

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
      Dim column%, Row%
       With MSChart1
          ' Displays a 3d chart with 8 columns and 8 rows
          ' data.
          .chartType = VtChChartType3dBar
          .ColumnCount = 8
          .RowCount = 8
          For column = 1 To 8
             For Row = 1 To 8
                .column = column
                .Row = Row
                .Data = Row * 10
             Next Row
          Next column
          ' Use the chart as the backdrop of the legend.
          .ShowLegend = True
          .SelectPart VtChPartTypePlot, 1, 2, _
          3, 4
          .EditCopy
          .SelectPart VtChPartTypeLegend, 1, _
          2, 3, 4
          .EditPaste
       End With
    End Sub

    I can post this, from Microsoft:


    (rename the file to remove the extra .txt extension. It's a zipped exe that auto-extracts.
    Attached Files Attached Files
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2008
    Posts
    2

    Thumbs up Re: VB 6.0 Mshart Control Problem

    Thanks for the feedback. I did try that one and its the one that gave all the proper labels but wouldn't display the data. I finally fixed the #@#$ thing! Took the array data and create a table then feed the table data into the chart and wonder of all wonders, it worked.

    Thanks again.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured