victory icon indicating copy to clipboard operation
victory copied to clipboard

Adding a container clips right side of chart

Open rossdack opened this issue 8 years ago • 1 comments

I've defined a simple candlestick chart which renders as:

screen shot 2018-10-24 at 12 51 21 pm

Specifying a container (to enable zoom for example) truncates the last candlestick, like so: screen shot 2018-10-24 at 12 58 51 pm

<VictoryChart
                width={this.state.chartWidth}
                height={450}
                candleWidth={55}
                theme={VictoryTheme.material}
                scale={{ x: 'time' }}
                standalone
                domainPadding={{ x: 25 }}
                containerComponent={<VictoryZoomContainer style={{paddingRight: 100}} 
              >
...

Is this an issue or simply a usage error?

rossdack avatar Oct 24 '18 01:10 rossdack

@rossdack VictoryZoomContainer adds a clipPath to the chart area so that anything rendered outside of it wont show. This is how zooming out is accomplished.

You can add padding to the clipPath it renders like so:

containerComponent={
  <VictoryZoomContainer 
    clipContainerComponent={<VictoryClipContainer clipPadding={{ left: 10, right: 10 }} />}
  />
}

boygirl avatar Oct 25 '18 17:10 boygirl