GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | CHART

Edit History

CHART

CHART charttype, A [, style [, x1, y1, x2, y2]]

Home > Reference > Graphics

Draws a chart of array values in the rectangular area given by the points [x1, y1] and [x2, y2]. The array A stores y-values only: [y1, y2, y3, … yn]. The x-axis of the chart has the values 1,2,3,…n.

charttype is a number with the following values:

Charttype Value
Linechart 1
Barchart 2

style is a number with the following values:

Style Value
simple 0
with marks 1
with ruler 2
with marks and ruler 3

See PLOT for plotting functions.

Example 1: Linechart with marks and ruler

demo = [1.5,2,3.5,4,5,6.5,7,8,9.5,10,11,12.5]
Color 0, 15
cls
Chart 1, demo, 3, 150, 150, 750, 550

Example 2: All charttypes and styles in one glance

Const LINE_CHART = 1
Const BAR_CHART  = 2
demo = [1.5,2,3.5,4,5,6.5,7,8,9.5,10,11,12.5]
Color 0, 15
For type = LINE_CHART To BAR_CHART ' 1 to 2
  text = Iff(type = LINE_CHART, "LINE_CHART", "BAR_CHART")
  For style = 0 To 3
    Cls
    Print " Chart Type: "; type; " ("; text; ")"
    Print " Chart Style: "; style
    Print
    Print "Press any key...";
    Chart type, demo, style, 150, 150, 750, 550
    Pause
  Next style
Next type
Code samples using CHART
chart.bas   Charts.bas   color chart.bas   crgb.bas   index.bas   rgb match and chart.bas   rgbcolors.bas   rogue trader.bas  
Graphics
ARC   CHART   CIRCLE   COLOR   DRAW   DRAWPOLY   IMAGE   LINE   PAINT   PEN   PLOT   POINT   PSET   RECT   RGB   RGBF   SHOWPAGE   TEXTHEIGHT   TEXTWIDTH   TXTH   TXTW   VIEW   WINDOW   XMAX   XPOS   YMAX   YPOS  
This page was last edited on Tue, 19 Sep 2023 16:07:13 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.