plottable icon indicating copy to clipboard operation
plottable copied to clipboard

AreaPlot / LinePlot should default to no padding on xScale

Open teamdandelion opened this issue 11 years ago • 9 comments
trafficstars

teamdandelion avatar Jul 29 '14 20:07 teamdandelion

Why is that? Please explain.

jtlan avatar Jul 30 '14 21:07 jtlan

Not sure about Line Plot actually. But for AreaPlot, having the fill cut out before the edge of the chart is ugly.

bad: image

good: image

teamdandelion avatar Jul 30 '14 22:07 teamdandelion

@crmorford is this still an issue? http://bower.io/stats/

rcchen avatar Feb 28 '15 00:02 rcchen

I want to change the defaults!

crmorford avatar Feb 28 '15 01:02 crmorford

Is there a setting to remove padding for line charts / xScale?

alyssaq avatar Aug 27 '15 09:08 alyssaq

Any update on this? Setting the xScale's outerPadding to 0 doesn't solve the issue for me. I want the graph to touch both ends of my component container.

http://jsfiddle.net/07h87qbb/2/

realph avatar Feb 02 '17 11:02 realph

In your fiddle @realph the inner and outer padding was set to 0.1, but if you set it to 0, it looks to me like it does go edge-to-edge: http://jsfiddle.net/5y0y4hj1/

image

themadcreator avatar Feb 02 '17 18:02 themadcreator

@themadcreator Sorry I posted the wrong fiddle, updated the fiddle link in my original question.

Managed to fix it by setting the innerPadding to 999. http://jsfiddle.net/07h87qbb/1/

Wanted to know if there was a better way around this.

realph avatar Feb 02 '17 18:02 realph

@realph The real value that controls the empty space is xScale.padProportion(0) - see http://plottablejs.org/docs/classes/plottable.scales.linear.html#padproportion . All scales have a default value of 0.05, setting it to 0.0 should work for you.

hellochar avatar Feb 02 '17 20:02 hellochar