WebChart Sample Pages on MySQL Database

Links: http://www.dbatools.net/mytools/webchart_mysql_examples.html

    With Java JDBC technology, WebChart can connect to many different types of database system, such as MySQL. Now I will show you some examples pages on MySQL. First, create the demo table with the following script in MySQL.

http://www.dbatools.net/doc/webchart_mysql.sql

    And then configure the database connection.

# WebChart Meta Datasource
ADMINDB=DEFAULT

# Enabled Data Source List
DBLIST=DEFAULT

# Connection Parameters for each data source
DEFAULT.DBTYPE=mysql
DEFAULT.DBHOST=localhost:3306/test
DEFAULT.DBUSER=
DEFAULT.DBPASS=1B820063CEA8A955
DEFAULT.MAXCONNS=8
DEFAULT.INITCONNS=2
DEFAULT.LOCALE=ENGLISH

    The first sample page (mysql1.wcml).

WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
      extract(month from trade_month) month, \
      extract(year from trade_month) year, \
      trade_count \
      from trade_summary_monthly
WEBCHART.CROSSTAB_1=on

    The second sample page (mysql2.wcml).

WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
      quarter(trade_month) quater, \
      extract(month from trade_month) month, \
      extract(year from trade_month) year, \
      trade_count  \
      from trade_summary_monthly
WEBCHART.CROSSTAB_1=quater,month|year|trade_count
WEBCHART.GROUP_1=2

    The third sample page (mysql3.wcml).

WEBCHART.XSLDOC=xsl/default.xsl
WEBCHART.QUERY_1=select \
      quarter(trade_month) quater, \
      extract(month from trade_month) month, \
      extract(year from trade_month) year, \
      trade_count  \
      from trade_summary_monthly
WEBCHART.CROSSTAB_1=quater,month|year|trade_count
WEBCHART.GROUP_1=2
WEBCHART.EXPRESS_1=Ratio|X/Y|2008,2007 \
                  Inc|X-Y|2008,2007

    The forth sample page (mysql4.wcml).

WEBCHART.XSLDOC=xsl/defchart.xsl
WEBCHART.TYPE=BAR
WEBCHART.WIDTH=480
WEBCHART.HEIGHT=240
WEBCHART.QUERY_1=select \
  trade_month, trade_count \
  from trade_summary_monthly

    You can create more MySQL samples according to previous Oracle examples.

Post a comment

« Previous | Main | Next »

Powered by
Movable Type 3.36