Home Forums Chart Support Chart is not taking up the entire height and leaving some padding

Chart is not taking up the entire height and leaving some padding

Viewing 3 posts - 1 through 3 (of 3 total)
  • #61998

    arj

    Hi Team,

    I am trying to render canvas chart with type area and I need height to be taken up completely by the chart no spacing should be allocated to the padding or margin.

    #61999

    arj

    this.layoutManager = new LayoutManager(0, 0, this.width, this.height, this.isNavigator ? 0 : 2);

    in my case isNavigator is set to false which is setting up this padding. How can i set it to true ensuring padding not allocated.

    #62005

    @arj,

    There isn’t a specific property in CanvasJS to completely remove the padding/margin around the chart area as of now. However, you can reduce or remove the extra space by setting a negative margin on the axis (depending on whether you’re using axisX & axisY, axisX2 & axisY2, or all of them). This usually helps to eliminate the visual gap on the sides. Please take a look at this JSFiddle for an example.
    Chart with Negative Axis Margin

    If that still doesn’t meet your requirement, you would need to modify the source code (included with every Developer License), as you have pointed out. For example: this.layoutManager = new LayoutManager(0, 0, this.width, this.height, 0);

    Modifying this value in the source is the solution if adjusting the axis margins does not solve the issue.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.