Swiftchart      to create your own chart and graph New! Swiftbarcodes! Barcodes by Swiftchart
EAN, UPC and many more ...
  Home | Examples | Parameters | Products | Contact us | Site map | FAQ Quick links : Get evaluation | Order
  Charts | CSV | JavaScript | Drill down | Popup label | JSP/Servlet Bar Graph | Line Graph

CSV example

In order to use csv files within Swiftchart please follow the following steps.


Step 1: Generating the csv file

There are many ways to generate a csv file. A csv file is a comma delimited data file. Many applications such as Excel or MS Access allow one to save data in csv format. But you can also generate csv files yourself as long as the data is comma delimited and each line is ended with a line break. In order Swiftchart can read the csv data, the file must hold the data in the following structure:



Step 2: Saving the csv file

The csv file must be accessible from the web site where the Swiftchart applet is located. Either the csv file is in the same directory or in a sub directory, or is accessible through a url. The "raw" file might look like this:



Step 3: Referring to the csv file within the applet tag

To base the chart data on a csv file the applet parameters csv_type and csv_location are used. The csv_type has to be set to Y and the csv_location has to point to the csv file location, either relative or by the full path (http://www ...). If the chart is based on a csv file, title_text, series label, series data and x_values parameters are ignored. The following is an example of a csv based Swiftchart applet tag:


<applet code="swiftchart.class" width="400" height="280">
<param name="depth3D" value="100">
<param name="csv_type" value="URL">
<param name="csv_location" value="multichart.csv">
<param name="chart_type" value="stackedbar3d">
<param name="applet_bg" value="CCCCCC">
<param name="chart_bg" value="EEEEEE">
<param name="title_font_color" value="000000">
<param name="title_font_size" value="16">
<param name="title_font_type" value="Dialog">
<param name="title_font_style" value="BOLD">
<param name="x_axis_font_color" value="000000">
<param name="x_axis_font_size" value="12">
<param name="x_axis_font_type" value="Times Roman">
<param name="x_axis_font_style" value="Italic">
<param name="x_axis_font_orientation" value="LEFT">
<param name="x_axis_occurrence" value="1">
<param name="y_axis_font_color" value="000000">
<param name="y_axis_font_size" value="12">
<param name="legend_position" value="RIGHT">
<param name="legend_font_color" value="000000">
<param name="legend_font_size" value="12">
<param name="data_value" value="BELOW">
<param name="data_value_font_color" value="000000">
<param name="data_value_font_size" value="10">
<param name="data_value_pct" value="Y">
<param name="grid_line" value="Y">
<param name="grid_line_color" value="999999">
<param name="s1_color" value="6699CC">
<param name="s2_color" value="FF9966">
<param name="s3_color" value="99CC99">
</applet>



The actual chart for the above listed examples will look like the following: