Comments (8)
Sorry for the delay! Was out on vacation.
I will look into this at some point this week. My first thought is perhaps a rounding issue since Spark is using floats for the x,y coords here. But those Y values look incorrect as well, so I'm not entirely sure.
from spark.
I think for timestamps the view needs a different way to calculate the distances between the value points. Maybe a getX override method that needs a date object?
from spark.
Ugh, sorry guys. I found out exactly why this graph appears the way it does.
My points on the x-line have a huge jump, notice halfway, instead of x-incrementing by 1 like it does all the time, it increments with ~230. Clumping all the first few values together on the left, and the other half on the right. I noticed this when I enlarged the graph by a lot.
"1466546073": 4.0,
"1466546304": 5.0,
This library is working as expected, the data was at fault.
from spark.
No worries, thanks for the follow up!
from spark.
Thinking about it a bit more, even though this representation is technically correct, it's not very helpful to the viewer, is it? Should an alternative representation be used when cases like these are detected? Stem graphs would work a little bit better in this case for example.
from spark.
The larger graph would look like this
The sparkstem could look like this, it's a lot clearer.
Not sure if it would be worth the time implementing all heuristics needed to decide what kind of plot to use however, I'm not even sure if that can be reliably done. Or if it is even within the scope of this project.
from spark.
This seems outside of the scope of Spark to me, since it's no longer a sparkline chart. I also don't think many apps that use Spark would want this behavior. And as you mentioned, detecting this case reliably is quite difficult.
I think Spark should maintain the current behavior, and apps can use custom logic in their SparkAdapters to massage the data however they might want.
from spark.
Thought so, thanks for taking the time to discuss this issue
from spark.
Related Issues (20)
- Does library support using List instead of float array? HOT 4
- question : support gradient color ? HOT 2
- [Request] New animation HOT 3
- Show min and max values. HOT 6
- Make use of Android annotations more consistent throughout library HOT 3
- Allow generic drawing effects HOT 3
- Setting cornerRadius to non-zero results in fill closing path also using radius HOT 1
- Fill with gradient HOT 3
- BaseLine dotted line sample HOT 2
- Thank you.. HOT 1
- Why doesn't onScrubbed include both x and y? HOT 6
- error: attribute spark_fillColor not found HOT 1
- Conditionally color sparkline HOT 1
- Android graph mismatch to actual charting data HOT 1
- shadow HOT 2
- Upgrade spark to androidx HOT 3
- 频繁调用notifyDataSetChanged, 导致native内存持续增高,且无法回收
- Using SparkAdapter with X and Y value and displaying both on onScrubbed() HOT 3
- can the scrubbing change from line to a button ? HOT 1
- Multiple lines in one chart? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark.