huww98 / TimeChart

An chart library specialized for large-scale time-series data, built on WebGL.

Home Page:https://huww98.github.io/TimeChart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid drawing series over Y axis padding area

debevv opened this issue · comments

Hi, is there a way to disable drawing in the padding area? If not, can you point me where I should start to edit the code?
Thank you

Hi, is there a way to disable drawing in the padding area?

No. I'm intended to make the viewport as large as possible.

If not, can you point me where I should start to edit the code?

There has been some time since I wrote these codes. As best as I can remember: You need to adjust the canvas positioning

style.left = style.right = style.top = style.bottom = '0';

Adjust the rendered domain (should be optional, change this should give you a little better performance)

const renderDomain = {
min: this.model.xScale.invert(-lineWidth / 2),
max: this.model.xScale.invert(this.width + lineWidth / 2),
};

Adjust how to calculate the origin point coordinate

const zero = [this.xSvgToView(m.xScale(0)!), this.ySvgToView(m.yScale(0)!)];

@huww98 Any chance you find the time to implement this as an option? This is something I would find very useful.

renderPadding* options are added in 1.0.0-beta.5. Please try it out. Or you can preview this feature at https://huww98.github.io/TimeChart/demo/

Tested the preview now, looks great!