pfuster12 / livechart Goto Github PK
View Code? Open in Web Editor NEWAndroid library to draw beautiful and rich line charts.
Home Page: https://pfuster12.github.io/LiveChart/livechart/index.html
License: MIT License
Android library to draw beautiful and rich line charts.
Home Page: https://pfuster12.github.io/LiveChart/livechart/index.html
License: MIT License
Hello,
That would be great to have the possibllity to define a gradient fill for second path as the first path.
Best
Description
Draw Y axis data points in steps between bounds
Version
1.0.0
Current behavior
Only shows bounds data points
Is your feature request related to a problem? Please describe.
The horizontal drag overlay style is hardcoded.
Describe the solution you'd like
Allow for styling of overlay with object similar to LiveChartView.
Version
1.2.0-alpha
Description
Draw the X Axis with text data points at key steps.
Version
1.0.0
Current behavior
No support for X axis
Is your feature request related to a problem? Please describe.
Color can only be set programmatically through styling.
Describe the solution you'd like
Add XML attribute to set directly in layouts
Version
1.0.0
Additional context
Describe the bug
Can't disable manual baseline and fill after setting them
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Disable again.
Is your feature request related to a problem?.
NO
**Describe **
Is it possible to make the upper baseline moves?
or maybe we can make the overlay moves in Horizontal way rather than Vertical one?.
in this case we will have multi points the line will intersect with, so I don't know if we can choose of theme some points show, or for now we might show them all!
Describe the solution you'd like
I'm still reading your code to better understanding, but I post my question so that you might give me some ideas to apply
Thanks Pablo.
I want to add this type of baseline please guide me about this.
image
Describe the solution you'd like
Return DataPoint value of touch event in chart
Version
1.2.0
Is your feature request related to a problem? Please describe.
Not an issue.
Describe the solution you'd like
When you trigger the onTouch callback, draw the current DataPoint your finger is closest to and display the Y axis value in a text tag next to it. As the finger drags across horizontally the DataPoint is drawn to match the current value.
A vertical line drawn across from the x axis can be added to help root the DataPoint to the axis.
Version
1.0.0
Current behavior
No support.
Additional context
See Trading 212, Yahoo FInance for similar feature.
Is your feature request related to a problem? Please describe.
Last data point tag always shown if Y axis is drawn.
Describe the solution you'd like
Public method to toggle draw tag drawLastDataPointTag()
Version
1.0.0
Describe the bug
If the Dataset
contains data that doesn't vary the y
coordinate the chart doesn't draw anything. Looking at the source code of the library it's probably caused because the lowerBound
and upperBound
for the Dataset
both are the same value and the LiveChartView
subtracts those values(result is zero) and then uses that value for various division and multiplication. The problem persists even if a second dataset is passed to the LiveChart with .setSecondDataset()
method.
To Reproduce
Steps to reproduce the behavior:
y
coordinatesliveChart.setDataset()
liveChart.drawDataset()
Expected behavior
The chart should display a line at the bottom of the chart.
Smartphone (please complete the following information):
Describe the bug
Great lib, love the simple designs.
It's however possible with certain datasets and configurations to get some quite strange looking graphs.
As an example take (over-exaggerated) dataset:
Dataset(
mutableListOf(
DataPoint(0f, 0f),
DataPoint(1f, 3.7f),
DataPoint(2f, 3.6f),
DataPoint(3f, 3.5f),
DataPoint(4f, 0f),
DataPoint(5f, 3.2f),
DataPoint(6f, 0f),
DataPoint(7f, 3.3f),
DataPoint(8f, 0f)
)
)
With XML
<com.yabu.livechart.view.LiveChart
android:id="@+id/dimensions_live_chart"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginStart="36dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="36dp"
android:layout_marginBottom="32dp"
app:layout_constraintBottom_toBottomOf="..."
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="..." />
And code
holder.dimensionsLiveChart.setDataset(it)
.drawSmoothPath()
.drawFill(false)
.drawHorizontalGuidelines(steps = 3)
.drawBaselineConditionalColor()
.setBaselineManually(3f)
.setOnTouchCallbackListener(object : LiveChart.OnTouchCallback {
@SuppressLint("SetTextI18n")
override fun onTouchCallback(point: DataPoint) {
//ommited
}
override fun onTouchFinished() {
//omitted
}
})
.drawDataset()
}
This results in:
3.88
which is a point provided by smoothing but not a real value. As smoothing is a pure "visual" feature, I find it strange that datapoints are not accurately returned in this case.Observed behaviour
In a scrollview, touch overlay stops working if you move slightly up or down and trigger the scroll event of the parent.
version
1.2.0
Describe the solution you'd like
Draw background vertical and horizontal n number of guidelines.
Public api:
drawVerticalGuidelines(steps=4)
drawHorizontalGuidelines(steps=4)
where steps
is the number of guidelines evenly distributed in the chart.
Version
1.2.3
Additional context
Allow for styling of guidelines too.
Am using java for android dev and trying to access LiveChart and other classes but none of them are accessible even after adding dependencies of it. Does this only work kotlin?
Describe the bug
Touch tracking does not match the position of finger.
This is happening because the tracking uses the x-coordinate of the finger to map to the length of the path, instead of mapping to the same x-coordinate of the path.
To Reproduce
Steps to reproduce the behavior:
2. Tap and move on a LiveChart
3.See tracking dot not on finger position
Expected behavior
Dot matches finger pos exactly
Hello. I am not pretty sure that it is good idea to use MutableList
in Dataset
. My point is that we could use private val points: List<DataPoint>
instead. The reason of my suggestion in fact that it is not good when everybody knows that the list inside of Dataset
is mutable.
Describe the bug
The Fill path for datasets always start at x=0 coordinate, even if dataset doesn't.
To Reproduce
Steps to reproduce the behavior:
drawFill()
Expected behavior
Fill path start at dataset start.
Hello,
That would be great to have the possibllity to set an option to fill until the baseline.
For ex: I can have a baseline at 10f and gradient will only fill the area between the path and the baseline. So when path is above the baseline it wont fill below the baseline and when the baseline is below the baseline it wont fill above the baseline for that area.
Best
Is your feature request related to a problem? Please describe.
Callback when Touch event stops.
Describe the solution you'd like
A second interface function in LiveChart.OnTouchCallback
to override when the touch event has ended in the LiveChart.
Version
1.2.0
Animations between Dataset Changes
Make an animation when dataset changes like here: https://github.com/hashlin/rally#graphs-and-tabs
Steps to reproduce the behavior:
When using these datasets:
generateDataSet 1: Dataset(points=[DataPoint(x=0.0, y=0.4446), DataPoint(x=1.0, y=0.4446), DataPoint(x=2.0, y=0.4446), DataPoint(x=3.0, y=0.4446), DataPoint(x=4.0, y=0.4446), DataPoint(x=5.0, y=0.4446), DataPoint(x=6.0, y=0.4446), DataPoint(x=7.0, y=0.4446), DataPoint(x=8.0, y=0.4446), DataPoint(x=9.0, y=0.4446), DataPoint(x=10.0, y=0.4446), DataPoint(x=11.0, y=0.4446), DataPoint(x=12.0, y=0.4446), DataPoint(x=13.0, y=0.4446), DataPoint(x=14.0, y=0.4446), DataPoint(x=15.0, y=0.4446), DataPoint(x=16.0, y=0.4446), DataPoint(x=17.0, y=0.4446), DataPoint(x=18.0, y=0.4446), DataPoint(x=19.0, y=0.4446), DataPoint(x=20.0, y=0.4446), DataPoint(x=21.0, y=0.4446), DataPoint(x=22.0, y=0.4446), DataPoint(x=23.0, y=0.4446), DataPoint(x=24.0, y=0.4446), DataPoint(x=25.0, y=0.4446)])
generateDataSet 2: Dataset(points=[DataPoint(x=26.0, y=0.4446), DataPoint(x=27.0, y=0.4446)])
This will crash the app if you want to show gradient fill.
I think this happens in case of dataset 2 having same Y values as last dataset1 y value.
I have managed to create a quickfix with this code:
.drawFill(withGradient = !isAllSame())
private fun isAllSame(): Boolean {
val pointY = dataSet2.points[0].y
return dataSet2.points.all { it.y == pointY }
}
Describe the solution you'd like
Style bounds color and second dataset with xml
Version
1.2.3
Is your feature request related to a problem? Please describe.
Fill can only be a gradient
Describe the solution you'd like
Support different fills and colors
Version
1.0.0
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Display touch overlay all the time, not just on Touch.
Use draw flag such as displayTouchOverlay()
Version
1.3.4
Additional context
The bounds labels are incorrectly calculated and placed.
Is your feature request related to a problem? Please describe.
Path defaults to one thickness
Describe the solution you'd like
Public method to set path thickness: setThickness(value: Float)
Version
1.0.0
Is your feature request related to a problem? Please describe.
Currently the chart allows to draw two datasets explicitly set.
Describe the solution you'd like
Draw datasets from a list, to allow for as many as needed: setDatasets(sets: List<Datasets>)
Allow setting colours setDatasetsColors(colors: List<Int>)
, otherwise a random assortment of colors are assigned.
Version
1.0.0
Is your feature request related to a problem? Please describe.
The Y axis text labels are hardcoded at 4.
Describe the solution you'd like
Draw n number with a public api like drawYAxisLabels(steps: Int)
Version
1.3.4
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
@Pfuster12 Hi Pablo, thanks for new version, this is very useful and beautiful livecharts!
Describe the solution you'd like
A clear and concise description of what you want to happen.
If the .drawTouchOverlayAlways()
option is turned on, is it possible that its position is not always in the middle of the chart?
I mean, is it possible to set the position of the circular button programmatically?
Version
1.3.5
Additional context
Add any other context or screenshots about the feature request here.
Describe the solution you'd like
Draw Y Axis and labels at the start or end of the chart.
Toggle by passing a Gravity.START
or Gravity.END
enum to the existing public API
drawYBounds(gravity: Gravity)
Version
1.3.3
Support Smooth path
Implementation
https://www.stkent.com/2015/07/03/building-smooth-paths-using-bezier-curves.html
Hello, I should display a circular indicator all the time, is that possible?
Is your feature request related to a problem? Please describe.
Chart changes color when positive/negative from baseline.
Describe the solution you'd like
Flag to disable this feature and keep graph as color set always.
Something like disableBaselineConditionalColor()
Version
1.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.