Search code examples
anychart

Axis stroke in anystock?


I am trying to change the axis stroke and axis font color in an anystock chart. I tried using the normal method for anycharts and it didn't work. Is there a way to change these values?


Solution

  • You are probably looking for these methods:

    https://api.anychart.com/7.14.3/anychart.core.stock.Plot#yAxis https://api.anychart.com/7.14.3/anychart.core.stock.Plot#xAxis

    Here is a sample: https://jsfiddle.net/vmgwemws/

      chart.plot(0).yAxis().stroke("Red");
      chart.plot(0).yAxis().ticks().stroke("Red"); 
      chart.plot(0).yAxis().labels().fontColor("Red");
      chart.plot(0).yAxis().labels().fontFamily("Courier");
    
      chart.plot(0).xAxis().labels().fontColor("Red");
      chart.plot(0).xAxis().labels().fontFamily("Courier");
    
      chart.plot(0).xAxis().minorLabels().fontColor("Red");
      chart.plot(0).xAxis().minorLabels().fontFamily("Courier");
    
      chart.plot(0).xAxis().background("Gray 0.5");