Git Product home page Git Product logo

suitlines's Issues

提示信息怎么一直停留在哪里?

提示的信息怎么一直停留在 哪里。。现在是点击抬起的时候才显示的。并且都是一闪而过,改那个动画的时间还是不行。不知道修改哪里了。。。怎样才能一直停留在哪里?

Implementation in viewPager

Hi @whataa i try to implement the Suitlines in viewPager Adapter which extends PagerAdapter, but it is keep giving me this error:

Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class

Caused by: java.lang.reflect.InvocationTargetException

04-08 15:06:22.370 15856-15856/com.xyz W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)

04-08 15:06:22.370 15856-15856/com.xyz W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:430)

04-08 15:06:22.370 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:652)

04-08 15:06:22.370 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)

04-08 15:06:22.370 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:525)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:427)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.tentwenty.notifyme.adapter.HomeGraphSlideAdapter.instantiateItem(HomeGraphSlideAdapter.java:57)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.tentwenty.notifyme.adapter.HomeGraphSlideAdapter.instantiateItem(HomeGraphSlideAdapter.java:34)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1002)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.support.v4.view.ViewPager.populate(ViewPager.java:1150)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.support.v4.view.ViewPager.populate(ViewPager.java:1084)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:534)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.tentwenty.notifyme.activity.HomeGraphDetailActivity$GetGraphDataNetworkThread$1.onSuccess(HomeGraphDetailActivity.java:389)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.loopj.android.http.JsonHttpResponseHandler$1$1.run(JsonHttpResponseHandler.java:152)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.os.Handler.handleCallback(Handler.java:751)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.os.Looper.loop(Looper.java:154)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6682)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at java.lang.reflect.Method.invoke(Native Method)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)

04-08 15:06:22.371 15856-15856/com.xyz W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

04-08 15:06:22.372 15856-15856/com.xyz W/System.err: Caused by: java.lang.ClassCastException: android.app.Application cannot be cast to android.app.Activity

04-08 15:06:22.372 15856-15856/com.xyz W/System.err: at com.tentwenty.notifyme.graph.suitlines.SuitLines.(SuitLines.java:82)

04-08 15:06:22.373 15856-15856/com.xyz W/System.err: at com.tentwenty.notifyme.graph.suitlines.SuitLines.(SuitLines.java:0)

Please let me know what i am doing wrong. Thank you.

显示精度问题 百条数据以上 曲线图会变成阶梯状

SuitLines.java 的 calcUnitXY()方法
float scale = new BigDecimal("1").subtract( (new BigDecimal(Float.toString(curValue)) .subtract(new BigDecimal(Float.toString(minAndMaxOfY[0])))) .divide(new BigDecimal(Float.toString(absValueOfY)), 2,BigDecimal.ROUND_DOWN)
在最大数据等于400
当前值为 250 和 249时
1-250/400 =0.375
1-249/400 =0.3775
如果只保留小数到2位 则画出来的高度是一样的 建议多保留几位小数。

不能自动加载多条线段?

除了按BUTTON点击才能添加线段以外,页面加载完无法自动显示多条线段?如果写在oncreate onresume方法中会报空指针异常,如果写在界面加载完成的监听里只能显示一条(多条),这是什么原因呢?

画图适配

请教一个问题,您是如何处理画图适配屏幕的问题的呢?

在fragment中画多条线会出现控制针,排除生命周期问题,在onresume方法里使用也是空指针

java.lang.NullPointerException: Attempt to read from field 'float android.graphics.RectF.left' on a null object reference
at tech.linjiang.suitlines.SuitLines.buildPaintColor(SuitLines.java:811)
at tech.linjiang.suitlines.SuitLines.access$1000(SuitLines.java:58)
at tech.linjiang.suitlines.SuitLines$LineBuilder.build(SuitLines.java:1362)
at com.handtv.jbw.clevermediation.view.fragment.HomeFragment.init(HomeFragment.java:183)
at com.handtv.jbw.clevermediation.view.fragment.HomeFragment.initView(HomeFragment.java:156)
at rxfamily.view.BaseFragment.onCreateView(BaseFragment.java:69)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192

画多条线时崩溃

Caused by: java.lang.NullPointerException: Attempt to read from field 'float android.graphics.RectF.left' on a null object reference
at tech.linjiang.suitlines.SuitLines.buildPaintColor(SuitLines.java:776)
at tech.linjiang.suitlines.SuitLines.access$1000(SuitLines.java:58)

请教一个问题

你好,我想问下在布局xml中或者在代码中如何设置图表的线段或者线段构成的整个区域的颜色。
我在你的例子中找到的方法是setDefaultOneLineColor(colors);
但是用的过程中发现报了空指针的错误,也许是我把这句代码的位置写错了,分析应该是这个方法执行的时候suitlines对象还没有创建完成吧。
最后我在Activity中的onWindowFocusChanged(boolean hasFocus) 方法中使用setDefaultOneLineColor是可以的,但是总感觉不是很对,请问下正确的使用方式,感谢。

偶尔会出现的闪退请款,是什么原因...求大神看看!!

Process: com.lixiangdong.weatherforecast, PID: 15881
java.lang.NullPointerException: Attempt to read from field 'float android.graphics.PointF.y' on a null object reference
at tech.linjiang.suitlines.SuitLines.drawLines(SuitLines.java:660)
at tech.linjiang.suitlines.SuitLines.onDraw(SuitLines.java:437)
at android.view.View.draw(View.java:17077)
at tech.linjiang.suitlines.SuitLines.draw(SuitLines.java:391)
at

private void drawLines(Canvas canvas, int startIndex, int endIndex) {
for (int i = 0; i < paths.size(); i++) {
paths.get(i).reset();
}
for (int i = startIndex; i <= endIndex; i++) {
for (int j = 0; j < datas.size(); j++) {
Unit current = datas.get(j).get(i);
float curY = linesArea.bottom - (linesArea.bottom - current.getXY().y) * current.getPercent(); // 报错包的是这一行代码中的 current.getXY().y
if (i == startIndex) {
paths.get(j).moveTo(current.getXY().x, curY);
continue;
}
if (lineType == SEGMENT) {
paths.get(j).lineTo(current.getXY().x, curY);
} else if (lineType == CURVE) {
// 到这里肯定不是起始点,所以可以减1
Unit previous = datas.get(j).get(i - 1);
// 两个锚点的坐标x为中点的x,y分别是两个连接点的y
paths.get(j).cubicTo((previous.getXY().x + current.getXY().x) / 2,
linesArea.bottom - (linesArea.bottom - previous.getXY().y) * previous.getPercent(),
(previous.getXY().x + current.getXY().x) / 2, curY,
current.getXY().x, curY);
}
if (!needCoverLine && isLineFill() && i == endIndex) {
paths.get(j).lineTo(current.getXY().x, linesArea.bottom);
paths.get(j).lineTo(datas.get(j).get(startIndex).getXY().x, linesArea.bottom);
paths.get(j).close();
}
}
}
drawExsitDirectly(canvas);
}

体温

这个图表库支持放大缩小不,支持动态刷新数据不(效果是动态心电图)

为什么直接设置4条线就会报空指针~

Caused by: java.lang.NullPointerException: Attempt to read from field 'float android.graphics.RectF.left' on a null object reference
at tech.linjiang.suitlines.SuitLines.buildPaintColor(SuitLines.java:814)
at tech.linjiang.suitlines.SuitLines.access$1000(SuitLines.java:61)
at tech.linjiang.suitlines.SuitLines$LineBuilder.build(SuitLines.java:1375)
at tech.linjiang.suitlines.simple.DemoChartActivity.init(DemoChartActivity.java:139)
at tech.linjiang.suitlines.simple.DemoChartActivity.onCreate(DemoChartActivity.java:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.