Home Forums StockChart Support Setting option for every chart in multi-chart view

Setting option for every chart in multi-chart view

Viewing 4 posts - 1 through 4 (of 4 total)
  • #36542

    From https://canvasjs.com/react-stockcharts/stockchart-date-time-axis-react/ this graph,

    I want to enable/disable grid/reference line on charts in single and multi view.

    However, I want to provide setting option to user to do the above, similar to below screenshot.

    file://C:/Users/Sandeep/Desktop/multichart%20setting.PNG

    Is it available with single/multiple data with React?

    #36553

    @sandeep-sharma2,

    The image shared above seems to be broken. Can you kindly upload the image to imgur and share it with us so that we can understand your scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

    #36556

    Thanks @manoj-mohan, please find below image

    Image 1
    Image 2

    Setting option for every chart
    setting option

    #36571

    @sandeep-sharma2,

    You can hide and unhide the axis gridlines by setting axis gridThickness to 0 and positive value respectively as shown in the below code snippet.

    toggleGridLines() {
      for(var i = 0; i < this.charts.length; i++) {
      	for(var j = 0; j < this.charts[i].axisY.length; j++) {
        	this.charts[i].axisY[j].set("gridThickness", (this.charts[i].axisY[j].gridThickness ^ 1))
        }
      }
    }

    Also, check out this StackBlitz example for hide/unhide axis gridlines on click of a button.

    Hide/Unhide axis grids on Click of Button

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.