Skip to main content

[archive] MSChart Question

  • February 23, 2004
  • 30 replies
  • 2 views

Show first post

30 replies

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 February 2004]

We are using the Microsoft Chart Control 6.0 Active-X control to display a pie chart of values. The chart works great and our values are displayed in the graphical form correctly. Our problem is that we want to also show the numeric values for each slice of the pie.

We have tried to use the Microsoft Office Chart 10.0 control but can't see to figure out how to plug data into the columns that we created. This control will show the values but we can't make our cobol program load the data sheet.

Any help on either of these will be appreciated.

Thanks
Here we go!


       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  BOMB-CODE.
       AUTHOR.                      An Idiot.
       REMARKS.

       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
       COPY "MSCHART.DEF".
                .
       WORKING-STORAGE              SECTION.
       77  wrk-axis             usage is handle of @axis.
       77  wrk-label            usage is handle of @label.
       77  ind                  pic 9(03)   comp-3         value zeroes.
       77  ind1                 pic 9(03)   comp-3         value zeroes.

      *this really comes from a linkage
       78  lnk-col              value 15.
       78  lnk-fil              value 5.
       78  lnk-titulo           value "Please, Work!".
       SCREEN                       SECTION.

       01 CHART-FORM.
           03 ax-graf               MSCHART
              COL                   5
              LINE                  2
              LINES                 30
              SIZE                  50
              LICENSE-KEY "8E147C69-BD50-11d1-B137-0000F8753F5D".

       PROCEDURE DIVISION.
       ACU-MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   LINES            60
                   SIZE             80
                   BACKGROUND-LOW
                   TITLE            "Bomb Code".
           DISPLAY CHART-FORM.

           modify  ax-graf,
              @DataGrid::RowLabelCount      = 1
              @DataGrid::ColumnLabelCount   = 1
              @DataGrid::ColumnCount        = lnk-col
              @DataGrid::RowCount           = lnk-fil
              @ChartType                    = 0
              @showlegend                   = 1
              @titletext                    = lnk-titulo.

           inquire ax-graf, @plot::@axis(VtChAxisIdX) in wrk-axis.
           inquire ax-graf, @plot::@axis(VtChAxisIdX)::@Labels::@Count()
              giving ind.
     
           perform until ind = 0
              inquire wrk-axis, @Labels::@item(ind) in wrk-label
     
              use wrk-label
                 modify ^@font::@name = "Courier"
                        ^@font::@size = 16
              end-use
              subtract 1 from ind
           end-perform.
     
           perform varying ind from 1 by 1 until ind > lnk-col
      *titulos de columnas
              modify ax-graf,   @DataGrid::ColumnLabel(ind, 1, ind)
              perform varying ind1 from 1 by 1 until ind1 > lnk-fil
      *datos(fila, columa)
                 modify ax-graf,   
                    @row     = ind1
                    @column  = ind
                    @data    = ind1 ind
              end-perform
           end-perform.
      *titulos de filas
           perform varying ind from 1 by 1 until ind > lnk-fil
              modify ax-graf,   @DataGrid::rowlabel(ind, 1, ind)
           end-perform.
     
           modify ax-graf, @plot::view3d::rotation(90).

           ACCEPT  OMITTED.
           EXIT    PROGRAM
           STOP    RUN
           .

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 February 2004]

We are using the Microsoft Chart Control 6.0 Active-X control to display a pie chart of values. The chart works great and our values are displayed in the graphical form correctly. Our problem is that we want to also show the numeric values for each slice of the pie.

We have tried to use the Microsoft Office Chart 10.0 control but can't see to figure out how to plug data into the columns that we created. This control will show the values but we can't make our cobol program load the data sheet.

Any help on either of these will be appreciated.

Thanks
Your major err is that you inquire GIVING, this is not what you should do.
At any rate, as you already have the wrk-axis inquired on the line before, I suggest you simplify your line:
inquire ax-graf, @plot::@axis(VtChAxisIdX)::@Labels::@Count() giving ind.
to:
inquire wrk-axis, @Labels::@Count IN ind.

Your USE statement is also slightly wrong it should go:

use wrk-label @Font
    modify [EMAIL="^@name"]^@name[/EMAIL] = "Courier"
             [EMAIL="^@size"]^@size[/EMAIL] = 16
end-use

Note that if you want to use @Font, you will have to include the acuclass.def file. On the contrary, you can use the @VtFont instead of @Font, this will work as long as you do not try to set the font object all together.

Full source that compiles:

       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  BOMB-CODE.
       AUTHOR.                      An Idiot.
       REMARKS.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
       COPY "MSCHART.DEF".
                .
       WORKING-STORAGE              SECTION.
       77  wrk-axis             usage is handle of @axis.
       77  wrk-label            usage is handle of @Label.
       77  ind                  pic 9(03)   comp-3         value zeroes.
       77  ind1                 pic 9(03)   comp-3         value zeroes.
      *this really comes from a linkage
       78  lnk-col              value 15.
       78  lnk-fil              value 5.
       78  lnk-titulo           value "Please, Work!".
       SCREEN                       SECTION.
       01 CHART-FORM.
           03 ax-graf               MSCHART
              COL                   5
              LINE                  2
              LINES                 30
              SIZE                  50
              LICENSE-KEY "8E147C69-BD50-11d1-B137-0000F8753F5D".
       PROCEDURE DIVISION.
       ACU-MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   LINES            60
                   SIZE             80
                   BACKGROUND-LOW
                   TITLE            "Bomb Code".
           DISPLAY CHART-FORM.
           modify  ax-graf,
              @DataGrid::RowLabelCount      = 1
              @DataGrid::ColumnLabelCount   = 1
              @DataGrid::ColumnCount        = lnk-col
              @DataGrid::RowCount           = lnk-fil
              @ChartType                    = 0
              @showlegend                   = 1
              @titletext                    = lnk-titulo.
           inquire ax-graf, @plot::@axis(VtChAxisIdX) in wrk-axis.
           inquire wrk-axis, @Labels::@Count IN ind.
     
           perform until ind = 0
              inquire wrk-axis, @Labels::@item(ind) in wrk-label
     
              use wrk-label @VtFont
                 modify [EMAIL="^@name"]^@name[/EMAIL] = "Courier"
                        [EMAIL="^@size"]^@size[/EMAIL] = 16
              end-use
              subtract 1 from ind
           end-perform.
     
           perform varying ind from 1 by 1 until ind > lnk-col
      *titulos de columnas
              modify ax-graf,   @DataGrid::ColumnLabel(ind, 1, ind)
              perform varying ind1 from 1 by 1 until ind1 > lnk-fil
      *datos(fila, columa)
                 modify ax-graf,   
                    @row     = ind1
                    @column  = ind
                    @data    = ind1 ind
              end-perform
           end-perform.
      *titulos de filas
           perform varying ind from 1 by 1 until ind > lnk-fil
              modify ax-graf,   @DataGrid::rowlabel(ind, 1, ind)
           end-perform.
     
           modify ax-graf, @plot::view3d::rotation(90).
           ACCEPT  OMITTED.
           EXIT    PROGRAM
           STOP    RUN
           .

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 February 2004]

We are using the Microsoft Chart Control 6.0 Active-X control to display a pie chart of values. The chart works great and our values are displayed in the graphical form correctly. Our problem is that we want to also show the numeric values for each slice of the pie.

We have tried to use the Microsoft Office Chart 10.0 control but can't see to figure out how to plug data into the columns that we created. This control will show the values but we can't make our cobol program load the data sheet.

Any help on either of these will be appreciated.

Thanks
Ok Gisle, thanks for the fixes, i'll try them. Woho!

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 February 2004]

We are using the Microsoft Chart Control 6.0 Active-X control to display a pie chart of values. The chart works great and our values are displayed in the graphical form correctly. Our problem is that we want to also show the numeric values for each slice of the pie.

We have tried to use the Microsoft Office Chart 10.0 control but can't see to figure out how to plug data into the columns that we created. This control will show the values but we can't make our cobol program load the data sheet.

Any help on either of these will be appreciated.

Thanks
Ok Gisle, thanks for the fixes, i'll try them. Woho!

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 February 2004]

We are using the Microsoft Chart Control 6.0 Active-X control to display a pie chart of values. The chart works great and our values are displayed in the graphical form correctly. Our problem is that we want to also show the numeric values for each slice of the pie.

We have tried to use the Microsoft Office Chart 10.0 control but can't see to figure out how to plug data into the columns that we created. This control will show the values but we can't make our cobol program load the data sheet.

Any help on either of these will be appreciated.

Thanks
Ok Gisle, thanks for the fixes, i'll try them. Woho!