Comments (6)
Hello! Thanks for the report. The problem seems to be that, for a data set whose every y value is zero, ChartValues.minY
and ChartValues.maxY
are both zero by default. Their difference is zero, which leads to division by zero, and so things fall apart. We’ll update the logic such that the default y range is [0, 1] for such data. In the meantime, to fix the problem, you can use an AxisValuesOverrider
implementation along these lines:
object : AxisValuesOverrider<ChartEntryModel> {
override fun getMaxY(model: ChartEntryModel) = if (model.maxY != 0) model.maxY else 1f
}
For MergeMode.Stack
, replace model.maxY
with model.stackedPositiveY
.
from vico.
Thanks, just dropped that in and it worked a treat 👍
from vico.
I’m glad to hear that. You’re welcome!
from vico.
Vico 2.0.0 Alpha 4 introduces the improvement mentioned above.
from vico.
This will be resolved in Vico 1 too—Vico 1.14.0 Alpha 1 includes the fix.
from vico.
Vico 1.14.0 is rolling out. Cheers!
from vico.
Related Issues (20)
- Marker missing style defined by custom MarkerLabelFormatter HOT 9
- Cannot access CartesianChartHost in my project HOT 2
- Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied HOT 6
- Cannot make a LabelFormatter on stacked column chart HOT 11
- Markers only works for the first line series HOT 2
- Crash on changing dataset which contains negative values HOT 3
- Throwing OOM Exception when using Chart in LazyColumn HOT 7
- Marker duplicated HOT 2
- No axisValueOverrider in rememberCandlestickCartesianLayer HOT 4
- Feature Missing - Slide to Position HOT 4
- Text alignment on y-axis label only shown correctly for ALIGN_NORMAL HOT 6
- [View] CartesianChartView always handles touches, even if `isClickable` or `isEnabled` is false HOT 6
- Cannot Round NaN to Float HOT 4
- Crash inside AnimatedVisibility() HOT 4
- ColumnChart with MergeMode.Grouped does not receive callback for all the series added through CartesianMarkerVisibilityListener HOT 2
- TopBottomShader.splitY doesn't do anything HOT 1
- Incorrect floating point rounding in xSpacingMultiplier calculation leads to wrong IllegalStateException HOT 6
- At the end the label of bottom axis is cut off HOT 5
- Couple crashes with `java.util.ConcurrentModificationException` and `java.util.NoSuchElementException: Key null is missing in the map` HOT 8
- Bottom label truncated sometimes HOT 8
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 vico.