Highcharts Demo

author(s): Torstein Hønsi

by Black Label

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<div id="container"></div>
<button id="getcsv">Alert CSV</button>

JavaScript

var H = Highcharts;

         H.Chart.prototype.getDataRows = function(multiLevelHeaders) {
           var hasParallelCoords = this.hasParallelCoordinates,
             time = this.time,
             csvOptions = ((this.options.exporting && this.options.exporting.csv) || {}),
             xAxis, xAxes = this.xAxis,
             rows = {},
             rowArr = [],
             dataRows, topLevelColumnTitles = [],
             columnTitles = [],
             columnTitleObj, i, x, xTitle,
             // Options
             columnHeaderFormatter = function(item, key, keyLength) {
               if (csvOptions.columnHeaderFormatter) {
                 var s = csvOptions.columnHeaderFormatter(item, key, keyLength);
                 if (s !== false) {
                   return s;
                 }
               }
               if (!item) {
                 return 'Category';
               }
               if (item instanceof Highcharts.Axis) {
                 return (item.options.title && item.options.title.text) ||
                   (item.isDatetimeAxis ? 'DateTime' : 'Category');
               }
               if (multiLevelHeaders) {
                 return {
                   columnTitle: keyLength > 1 ?
                     key : item.name,
                   topLevelColumnTitle: item.name
                 };
               }
               return item.name + (keyLength > 1 ? ' (' + key + ')' : '');
             },
             // Map the categories for value axes
             getCategoryAndDateTimeMap = function(series, pointArrayMap, pIdx) {
               var categoryMap = {},
                 dateTimeValueAxisMap = {};
               pointArrayMap.forEach(function(prop) {
                 var axisName = ((series.keyToAxis && series.keyToAxis[prop]) ||
                     prop) + 'Axis',
                   // Points in parallel coordinates refers to all yAxis
                   // not only `series.yAxis`
                   axis =...