HTML-img Usage

Introduction

With this usage model users can embed chart images to any HTML content. The embedding page can be pure HTML page or any dynamic page (PHP, ASP, ...) producing HTML. The chart inclusion is done with an HTML img tag, whose src reference is pointing to a "getChart" service.

The difference between "HTML-JavaScript" and "HTML-img" usege models is that the later can not add image map to the HTML page. Also it can not serve other than image content.

Usage

User must add following code to a location where the chart image should appear.

<img src="http://server1/getChart?source=http://server2/chartxml/chart1.xml"/>

"server1" is a chart server URL and "server2" is a URL for a server serving Char XML document. The "source" attribute is mandatory and it is used to indicate the Chart XML location. There can be also other attributes. These attributes use same names as in "out" tag. Following example adds a "chartType" attribute with value "pie".

<img src="http://server1/getChart?source=http://server2/chartxml/chart1.xml&chartType=pie"/>

Setup

There must be a Davisor Chart running in a known server and the used Chart XML must be available (typically from a same or other server). Chart server should have following entries at web.xml:

  <servlet>
    <servlet-name>getChart</servlet-name>
    <servlet-class>com.davisor.webapp.chart.ChartContentServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>getChart</servlet-name>
    <url-pattern>/getChart</url-pattern>
  </servlet-mapping>

Example

Chart image shown in a example HTML page.