Custom chart marker, on a staggered interval, across the plotted line in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Custom chart marker, on a staggered interval, across the plotted line in line chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="height: 400px; max-width: 800px; margin: 0 auto"></div> 
      <script type="text/javascript">
var data = [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5];
for (var i = 0; i < data.length; i++) {
  data[i] = {//  ww  w.ja  v a2s  . com
    x: i,
    y: data[i]
  }
  if (i % 4 == 0) {
    data[i].marker = {
      symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
    };
  }
}
Highcharts.chart('container', {
  title: {
    text: 'Demo of predefined, image and custom marker symbols'
  },
  legend: {
    y: -40 // make room for subtitle
  },
  xAxis: {
    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  },
  series: [{
    name: 'Image symbol',
    data: data
  }],
  credits: {
    enabled: false
  },
  subtitle: {
    text: '*) Base64 not supported in IE6 and IE7',
    verticalAlign: 'bottom',
    align: 'right',
    y: null,
    style: {
      fontSize: '10px'
    }
  }
});

      </script>  
   </body>
</html>

Related Tutorials