EJSC.Chart Property Examples (Page 2)

Properties Demonstrated

  • Standard EJSC.Chart Properties

Desired Result

Default Chart Settings

Source Code

  1. <script type="text/javascript">
  2.   var chart = new EJSC.Chart("myChart1a", {
  3.   });
  4.   chart.addSeries(new EJSC.AreaSeries(
  5.     new EJSC.ArrayDataHandler([
  6.       [.5,4.7],[2.1,3],[3.5,4.2],[4,2.3]
  7.     ])
  8.   ));
  9. </script>

Properties Demonstrated

  • building_message
  • drawing_message
  • max_zoom_message

Desired Result

This chart will have custom building, drawing, and max zoom messages.

Source Code

  1. <script type="text/javascript">
  2.   var chart = new EJSC.Chart("myChart1b", {
  3.     building_message: 'Currently Building...',
  4.     drawing_message: 'Currently Drawing...',
  5.     max_zoom_message: 'No More Zooming'
  6.   });
  7.   chart.addSeries(new EJSC.AreaSeries(
  8.     new EJSC.ArrayDataHandler([
  9.       [.5,4.7],[2.1,3],[3.5,4.2],[4,2.3]
  10.     ])
  11.   ));
  12. </script>

Properties Demonstrated

  • allow_mouse_wheel_zoom
  • allow_move
  • legend_title

Desired Result

This chart will not allow zooming by using the mouse-wheel, and will not allow the chart to be dragged around once zoomed in.

Source Code

  1. <script type="text/javascript">
  2.   var chart = new EJSC.Chart("myChart2a", {
  3.     allow_mouse_wheel_zoom: false,
  4.     allow_move: false,
  5.     legend_title: 'My Legend Title'
  6.   });
  7.   chart.addSeries(new EJSC.LineSeries(
  8.     new EJSC.ArrayDataHandler([
  9.       [1,1],[2,2.5],[3,3.75],[4,2],[5,3]
  10.     ])
  11.   ));
  12. </script>

Properties Demonstrated

  • axis_bottom
  • axis_left
  • axis_right
  • axis_top

Desired Result

This chart will show all four axis, even though they are not all being used.

Source Code

  1. <script type="text/javascript">
  2.   var chart = new EJSC.Chart("myChart2b", {
  3.     axis_bottom: { show: true },
  4.     axis_left: { show: true },
  5.     axis_right: { show: true },
  6.     axis_top: { show: true }
  7.   });
  8.   chart.addSeries(new EJSC.LineSeries(
  9.     new EJSC.ArrayDataHandler([
  10.       [1,1],[2,2.5],[3,3.75],[4,2],[5,3]
  11.     ])
  12.   ));
  13. </script>

Properties Demonstrated

  • text_value_array

Desired Result

Default Chart Settings

Source Code

  1. <script type="text/javascript">
  2.   var chart = new EJSC.Chart("myChart3a", {
  3.     text_value_array: [
  4.       'First',
  5.       'Second',
  6.       'Third',
  7.       'Fourth'
  8.     ]
  9.   });
  10.   chart.addSeries(new EJSC.LineSeries(
  11.     new EJSC.ArrayDataHandler([
  12.       [1,.7],[2,4],[3,5],[4,6]
  13.     ])
  14.   ));
  15. </script>