Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameterized colors (also volume override) #3

Conversation

benoitjadinon
Copy link

@benoitjadinon benoitjadinon commented Jul 22, 2018

because I like me candles to be fully greeeen ;)

also used PaintingStyle to draw the outlines automagically

and added volumePaint, if null, will use candle colors

OHLCVGraph(
            data: _coinChartData,
            enableGridLines: true,
            volumeProp: 15/100,
            labelPrefix: "\$",
            gridLineAmount: 10,
            gridLineColor: Colors.grey[300],
            gridLineLabelColor: Colors.grey,
            greenPaint: new Paint()
              ..color = Colors.green
              ..strokeWidth = 1.0
              ..style = PaintingStyle.fill,
            volumePaint: new Paint()
              ..color = Colors.grey
              ..style = PaintingStyle.stroke,

iphone_x_-_11_4

@trentpiercy
Copy link
Owner

Thanks I like the idea and it definitely gives more customization but the problem is that PaintingStyle.fill and PaintingStyle.stroke behave differently so when you draw one rectangle as an outline and another as fill they're not uniform. That's why I just did it with lines instead and accounted for the difference. If you can make everything look uniform and also fix the spacing issues between bars (I think you would just have subtract/add lineWidth instead of lineWidth / 2 when establishing left and right) then I'd be happy to accept the PR.

@benoitjadinon
Copy link
Author

okay sry, I thought it was an oversight on PaintingStyle.fill.
by uniform you mean they're not the same size ? is the problem you're referring to happening in my screenshot above ?
seems weird coming from Skia... I'll do a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants