public function toJavascript()
  {
    ob_start();
    ?>
    <script type="text/javascript">
      jQuery( function( $ )
      {
        "use strict";

        Morris.<?php echo $this->__chart_type ?>(
          <?php echo $this->toJSON() ?>
        );
      } );
    </script>
    <?php
    $buffer = ob_get_contents();
    ob_end_clean();

    return $buffer;
  }