javascript - Highcharts area chart hide graphs with one data point -


i have product our customers can choose date range. 1 of our tools, make them area chart highcharts of data.

i've noticed when area chart has 1 data point on x axis, no graph shown. here's example in jsfiddle: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/area-basic/

code below posterity:

$(function () {     $('#container').highcharts({         chart: {             type: 'area'         },         title: {             text: 'us , ussr nuclear stockpiles'         },         subtitle: {             text: 'source: <a href="http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf">'+                 'thebulletin.metapress.com</a>'         },         xaxis: {             allowdecimals: false,             labels: {                 formatter: function() {                     return this.value; // clean, unformatted number year                 }             }         },         yaxis: {             title: {                 text: 'nuclear weapon states'             },             labels: {                 formatter: function() {                     return this.value / 1000 +'k';                 }             }         },         tooltip: {             pointformat: '{series.name} produced <b>{point.y:,.0f}</b><br/>warheads in {point.x}'         },         plotoptions: {             area: {                 pointstart: 1940,                 marker: {                     enabled: false,                     symbol: 'circle',                     radius: 2,                     states: {                         hover: {                             enabled: true                         }                     }                 }             }         },         series: [{             name: 'usa',             data: [10104 ]         }, {             name: 'ussr/russia',             data: [16000]         }]     }); }); 

the weird part this: chart empty, when hover on chart, can see data points. there way make points visible without hovering on them? perhaps option gives ticks width?

thanks!

in example when remove last datapoint see talking about. because in example marker not enabled. change true:

    plotoptions: {         area: {             pointstart: 1940,             marker: {                 enabled: true, //this false.                 symbol: 'circle',                 radius: 2,                 states: {                     hover: {                         enabled: true                     }                 }             }         }     }, 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -