.XY ADD BAR LAYER

This subroutine adds a Bar layer to the "current" chart spec.


Usage:

      PASS         <data_combine_method>          FIELD            SHARE? N
      PASS         <bar_color_style>              FIELD            SHARE? N
      GOSUB    0CD .XY ADD BAR LAYER
      *        Check for error
      IF       0CD .XY ADD BAR LAYER        NE

Description:

This subroutine adds a Bar layer to the "current" chart spec and automatically links the "current" dataset to it if there is one. You must have intialized the chart as an XY Chart via .CHART INITIALIZE for this to have any effect. This subroutine is typically used to add multiple data sets to a single bar layer. A Bar layer is simply a group of data points you want to plot. An XY chart can have one or more Bar layers. For example, if we wanted to plot sales by month for the current year, that would be one layer. If we wanted to show last years sales as well, that would be a second layer, and so on. Normally, multiple layers are shown separately on XY charts, however, if we want to show everything in one layer, we can use this subroutine to create the layer, then add data using fill me in.

This routine receives two optional values, a <data_combine_method> and a <bar_color_style>.

If we are only going to have one set of data points on our chart, then the <data_combine_method> does not really apply. If we have multiple sets of data points, then the <data_combine_method> will determine how they will be shown. Valid values are:

side - The data sets are combined by plotting the bars side by side.

stack - The data sets are combined by stacking up the bar segments.

overlay - The data sets are combined similar to stacked bars. However, in overlay, one data set is assumed to already include the other data set. For example, if the data sets are "average" and "peak", the "peak" cannot be stacked on top of "average", because the "peak" already contains "average". In the Overlay style, only "peak - average" is stacked on top of "average", and so the total bar length will be "peak".

percentage - The data sets are combined similar to stacked bars, except that the data in a bar are scaled so that they sum to 100. In other words, all stacked bars will be of the same length. A bar segment within a bar represents the percentage of the data item relative to sum of all the data items in the stacked bar.

If blank or not passed, then each data set will be plotted in it's own layer.

<bar_color_style> must be either blank or 'multiple'. Blank means that every bar in the layer will be the same color. 'Multiple' means that you will set the color of each bar via fill me in.

If you have created your data set before calling this subroutine, then your "current' dataset will be linked to the layer automatically.

Comments:

Read what other users have said about this page or add your own comments.


-- JeanNeron - 2011-10-12

Edit | Attach | Watch | Print version | History: r14 | r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2011-10-13 - JeanNeron
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback