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

时间轴挤在一起了 #14

Open
alun1 opened this issue Jan 24, 2019 · 4 comments
Open

时间轴挤在一起了 #14

alun1 opened this issue Jan 24, 2019 · 4 comments

Comments

@alun1
Copy link

alun1 commented Jan 24, 2019

qq 20190124115408

@alun1
Copy link
Author

alun1 commented Jan 24, 2019

大佬能指教一下吗

@fujianlian
Copy link
Owner

可以通过调整列数或者时间轴数据显示

@alun1
Copy link
Author

alun1 commented Jan 24, 2019

好的谢谢,还有一个问题就是,好像很多情况显示不出来MACD,比如30分钟,60分钟,日K 的数据就不行,而周K,月K是可以显示的

@HowKeung
Copy link

HowKeung commented Jul 17, 2019

列数已经比较少的情况下,比如5列,第一个和最后一个时间仍然会和挨着的时间重叠,可以修改显示的第一个时间和最后一个时间的位置,在BaseKLineChartView.java文件中drawText方法,
418行-422行是显示第一个时间,修改前

float translateX = xToTranslateX(0);
        if (translateX >= startX && translateX <= stopX) {
            canvas.drawText(getAdapter().getDate(mStartIndex), 0, y, mTextPaint);
        }

修改后

float translateX = xToTranslateX(0);
        if (translateX >= startX && translateX <= stopX) {
            String text = getAdapter().getDate(mStartIndex);
            canvas.drawText(text, 0 - mTextPaint.measureText(text) / 2, y, mTextPaint);
        }

418行-427行是显示最后一个时间
修改前

translateX = xToTranslateX(mWidth);
        if (translateX >= startX && translateX <= stopX) {
            String text = getAdapter().getDate(mStopIndex);
            canvas.drawText(text, mWidth - mTextPaint.measureText(text), y, mTextPaint);
        }

修改后

translateX = xToTranslateX(mWidth);
        if (translateX >= startX && translateX <= stopX) {
            String text = getAdapter().getDate(mStopIndex);
            canvas.drawText(text, mWidth - mTextPaint.measureText(text) / 2, y, mTextPaint);
        }

这样第一个时间和最后一个时间都只显示一半

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

No branches or pull requests

3 participants