javascript - Highcharts combining a column and spline chart from an html data table -
is possible show first series column, , second spline - in html table based highcharts chart?
eg. following link: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/column-parsed/ - shows 2 data series, both columns. how change code below, show first column, , second spline?
$(function () { $('#container').highcharts({ data: { table: document.getelementbyid('datatable') }, chart: { type: 'column' }, title: { text: 'data extracted html table in page' }, yaxis: { allowdecimals: false, title: { text: 'units' } }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.y +' '+ this.x.tolowercase(); } } }); }); <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/data.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> <table id="datatable"> <thead> <tr> <th></th> <th>jane</th> <th>john</th> </tr> </thead> <tbody> <tr> <th>apples</th> <td>3</td> <td>4</td> </tr> <tr> <th>pears</th> <td>2</td> <td>0</td> </tr> <tr> <th>plums</th> <td>5</td> <td>11</td> </tr> <tr> <th>bananas</th> <td>1</td> <td>1</td> </tr> <tr> <th>oranges</th> <td>2</td> <td>4</td> </tr> </tbody> </table>
thank you,
mark
in config, set series options first column
, second spline
:
series: [{type: 'column'}, {type:'spline'}]
update fiddle here.
Comments
Post a Comment