Emprise Javascript Charts

Line Chart Example

Description

This is an example of a simple line chart. It demonstrates use of the custom defined title, x_axis_caption, y_axis_caption, auto_zoom, auto_find_point_by_x, and show_crosshairs properties. These allow for the custom title, x axis caption, and y axis caption, an auto defined zoom range, the auto selection of points by position of cursor on the x axis, and the display of the x axis crosshairs. The series title was defined as well.

Source Code

  1. <script type=”text/javascript”>
  2.         var myChart1 = new EJSC.Chart( ‘myChart1a’ , {
  3.                                title: “Sample Line Chart” ,
  4.                                axis_bottom: { caption: “Frequency (Hz)” , crosshair: { show: true } } ,
  5.                                axis_left: { caption: “Velocity (in/s)” , crosshair: { show: false } } ,
  6.                                auto_zoom: ‘y’ ,
  7.                                auto_find_point_by_x: true
  8.                                }
  9.                        );
  10.         myChart1.addSeries( new EJSC.LineSeries( new EJSC.XMLDataHandler(“vibration2.xml”) , {
  11.                                                    title: “Line 1”,
  12.                                                     __padding: { x_min: 0, y_min: 1, x_max: 0, y_max: 5 }
  13.                                                    }
  14.                             )
  15.                  );
  16. </script>
Spread the love