Charts
Charts copied to clipboard
Candle stick chart not displaying when timestamp used for XAxis.
Hi,
I want to draw a Candle Stick Chart.
The candles are NOT displaying correctly if I use timestamp data for XAxis. The candles are displaying correctly if I use iteration index for XAxis.
- I have a line chart that is displaying like it should for the same kind of data(timestamp, X value). But when I use those data on candles chart it is not working.
CandleStickChartNotWorking.txt
Charts (3.2.2) Swift 4.0 Xcode 10.2.1
Thank you
Same problem also for CombinedChartView with BarChartData
Has anyone been able to solve this yet? I've just run into it 6 months later..
I had recently the same issue. Turns out that candle bars are simply just too narrow to be visible when time interval is used for X values. As a workaround I have time stamps stored in an array and I did assign index values from that array as X values instead. Other option may be some kind of multiplier but that may not work if time interval diff is small.
same problem here.. does anybody has any workaround instead of giving indexes of values ?
The issue is still present, any workaround?
for me too. candlestick chart not displaying when timestamp with timezone used for x axis.
I had come up with same issue and found workaround. In my case I was converting Instant to Epochseconds so the converted float value is in scientific notation. I assume which is causing the problem for you guys as well. here is my workaround
// divide by big number which will not return in scientific notation
new CandleEntry((float) candleStick.getTimeStamp().getEpochSecond() /100000
And add value formatter for Xaxis
candleStickChart.getXAxis().setValueFormatter(new DateValueFormatter());
In DateValueFormatter multiply with value with the above big number in my case 100000 , this will ensure not showing wrong dates in UI
@Override
public String getFormattedValue(float value) {
Date date = getDateValue(value * 100000);