Remove white Space on right side in Dygraphs

2019-06-06 02:22发布

问题:

I'm developing a chart without legend or axis. In this chart I'm also drawing via the 2d context and the underlayCallback option.

The Problem I can not resolve is a mysterious white space on the right side of the chart (about 5px).

I modified a jsFiddle to represent the Problem:

http://jsfiddle.net/12magkox/

Dygraph Constructor for removing the legend and the axis:

legend: 'never',
    axes: {
      x: {drawGrid: true, drawAxis: false},
      y: {drawGrid: true, drawAxis: false}
    },

回答1:

Check out the rightGap option. Your estimate of "about" 5px looks to be spot-on!

rightGap

Number of pixels to leave blank at the right edge of the Dygraph. This makes it easier to highlight the right-most data point.

Type: integer

Default: 5