Causeway->Demos->VML graphics->Scripted VML

Scripted VML


Home
  About us
  Contact info
  Vector graphics
  SVG Fills & Filters
Products
  Price list
  CSharp translator
  Dyalog
  APL2000
Support
  CUSP
  CausewayPro
  RainPro
  Newleaf
  Helpstuf
  Leafhtm
Tutorials
Demos
  Climate Charts
  VML graphics
    Rainfall at Gilling
    Population Pyramid
    Checkweigher
    Budget vs Actual
    Two Piecharts
    Several Barcharts
    Box & Whisker
    Wise Eels Bridge
    Response Surface
    Tabular Data
    Scripted VML
    Bouncing Ball
    Climate charts
  SVG examples
Free Stuff
  CSS Editor
Publications
  Seminars
  Articles
Causeway Graphical Systems

JavaScript

This is just to show that we can hook JavaScript handlers into VML graphics rather easily. The first example highlights the bars as the mouse passes over them, and when a bar is clicked it accumulates the total value into the heading. The second example shows how you might allow a user to change data and heading colours or fonts.

Handling chart events

-5

-4

-3

-2

-1

0

1

2

3

4

5

6

7

Click on the Bars to Accumulate the Total!

The total collected so far is 0

Note that the bars highlight on Mouse-over to indicate 'hot' regions

Jan

Feb

March

April

May

June

July

Aug

Sep

Oct

Nov

Dec

Changing the chart look and feel

This example simply adds some buttons to change the colours of the bars (and update the key to match) and switch the font of the axis labels. VML makes this very simple to program, as all the text elements are available as normal CSS2-positioned objects.

0

1

2

3

4

5

6

7

8

9

Change Series and Key Colours

Ensures we can get at all the interesting properties

with external JavaScript

 

Jan

Feb

Mar

Apr

May

Jun

Jul

Budget

projection

Actual

Sales

Clearly, you could change the wording also, but the layout of the chart will rapidly break apart if the text is significantly different from the original values.

This chart created with GraPL; to build it automatically from a script or server use GraPL.NET.


Website maintained by adrian@causeway.co.uk
Telephone: +44 (0) 1439 788413