Friday, 15 May 2015

Y-axis ticks in Highcharts -



Y-axis ticks in Highcharts -

in highcharts, there tick marks on x-axis default on x-axis (code snippet below), can't find way create tick marks on y axis. posible?

class="snippet-code-js lang-js prettyprint-override">$(function () { $('#container').highcharts({ title:{ text:'' }, xaxis: { gridlinecolor: 'transparent', title: { text: "x" }, gridlinewidth: 1, min: -5, max: 5, tickinterval: 1, }, yaxis: { gridlinecolor: 'transparent', title: { text: "y" }, min: -5, max: 5, tickinterval: 1, linewidth: 1, title: { text: null } }, legend: { enabled: false }, series: [{ type: "line", marker: { enabled: false }, data: [ [-3, 3], [-2, 2], [-1, 1], [0, 0], [1, 1], [2, 2], [3, 3] ] }] }); }); class="snippet-code-html lang-html prettyprint-override"><script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <div id="container" style="width: 400px; height: 400px"></div>

simply utilize ticklength , tickwidth:

yaxis: { ticklength: 10, tickwidth: 1 }

example: http://jsfiddle.net/7ox30pmy/

highcharts

No comments:

Post a Comment