-1

I've been scratching my head and reading the documentation a lot, trying to understand when using anychart stock how i can get control over the tick ( major/minor) display ? i.e i'd like to change the tick stroke color, the interval and make it rotate so text is vertical.

this is example data i'm playing with.

https://playground.anychart.com/sTrncP0D

Nothing special, i just want the major tick per minute and minor every 10 seconds if possible. I tried many variations but fail to get working combination and i think it's because the Stock axis differences.

Can you someone help how this is done ? Or if this is even possible.

thanks.

Flo Woo
  • 949
  • 1
  • 12
  • 26

1 Answers1

1

You can set ticks and minor ticks interval with the following lines:

var scale = chart.xScale();
scale.ticks([{major: {unit: 'minute', count: 1}, minor : {unit:'second', count: 10}}]);

You can rotate axis labels like this:

var labels = chart.plot().xAxis().labels();
minorLabels = chart.scroller().xAxis().minorLabels(); 
labels.rotation(90);
minorLabels.rotation(90);

You can adjust ticks appearance with the following lines:

var ticks = chart.plot().xAxis().ticks();
var minorTicks = chart.plot().xAxis().minorTicks();
ticks.stroke("red", 0.9);
minorTicks.stroke("blue", 0.9);
AnyChart Support
  • 3,770
  • 1
  • 10
  • 16