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

added invertYAxis feature #24

Closed
wants to merge 1 commit into from

Conversation

jstuth
Copy link
Contributor

@jstuth jstuth commented Jun 13, 2019

added invertYAxis property to BarChartData, LineChartData and AxisChartData --> property defaults to false

LineChartPainter / BarChartPainter overrides the getTopOffsetDrawSize method to return enough vertical space for the horizontal titles that are rendered on top when y-axis is inverted
LineChartPainter / BarChartPainter fixed content rendering when y axis is inverted

AxisChartPainter inverts most of the rendering in the getPixelY method, this is done by using the calculated y value without subtracting it from the chart height
fixed grid rendering in AxisChartPainter when y axis is inverted

i've checked my changes with your samples and it looked good so far. I hope i didn't messed up your code too much. maybe we can extract some of the calculations into methods.

…rtData --> property defaults to false

LineChartPainter / BarChartPainter overrides the getTopOffsetDrawSize method to return enough vertical space for the horizontal titles that are rendered on top when y-axis is inverted
LineChartPainter / BarChartPainter fixed content rendering when y axis is inverted

AxisChartPainter inverts most of the rendering in the getPixelY method, this is done by using the calculated y value without subtracting it from the chart height
fixed grid rendering in AxisChartPainter when y axis is inverted
@imaNNeo
Copy link
Owner

imaNNeo commented Jun 14, 2019

I checked it, but let's keep it simple, as I explained, we just want to add top and right titles,
and no more about inverting y-axis, because it can be handled by user behind of the library,
In the library, we just add a possibility to add top titles and hide bottom titles,
then the user can invert the y-axis by himself, and invert left titles, then give them to the chart,
I think it is okay and there is no need to make more effort on it

@jstuth
Copy link
Contributor Author

jstuth commented Jun 14, 2019

Ok, no Problem. I will keep my changes for now and use it on my own project till top titles will arrive.

@imaNNeo
Copy link
Owner

imaNNeo commented Jun 14, 2019

Sure,
I will add it ASAP, and make a sample of the inverted y-axis on samples :)

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.

2 participants