In Scichart Android version 4.2.0.4557, ICategoryLabelProvider.transformDataToIndex(Date var1); accept date as parameter
but at version 4.2.0.4608, int transformDataToIndex(double var1); it accept double?
then how to convert date to double?
and another question.
-
how set start tick axis in category date axis?
what i see here first tick of x axis always come with data, not like date axis which data can adapt their position itself. -
how to set time frame in date axis like category date axis?
-
without scichart builder i cannot set time frame in categorydateaxis
- Yuda Susanto asked 3 years ago
- You must login to post comments
Hi Yuda,
No it isn’t a bug – we’ve refactored LabelProvider for category axis and it required some changes in API. This specific change allowed us to remove unnecessary boxing/unboxing because of creating Date object. If you need to convert double to Date you can use our ComparableUtil.toDate() helper.
Regarding your other questions
1. It’s expected behavior – category axis is index based axis, so it uses DoubleRange as VisibleRange for specifying range of indices to display and ticks are also indices. Then LabelProvider transforms them into Dates and formats into strings.
2. You can’t do this out of the box because category axis expects range of indices, not range of Dates. May I ask what you’re trying to achieve?
3. I don’t understand the question. SciChartBuilder API provides a wrapper for more convenient chaining of property setters. If you don’t use builder API then you can directly set properties on axis (e.g. replace withVisibleRange on setVisibleRange and so on).
Best regards,
Yura
- Yura Khariton answered 3 years ago
- last edited 3 years ago
-
Hi thanks for your reply Problem solved 1. And Categorydateaxis doesnt support second format? 2. Okay, so the best use case for realtime trade is categorydateaxis right? 3. here is my code > xAxis = new CategoryDateAxis(DemoActivity.this); > xAxis.setBa setbarttime & getbartime never exist
-
Unfortunately CategoryDateAxis doesn’t support setting VisibleRange with DateRange, because when you’re using it it’s possible that someone adds data series where points have same Date values. And if someone does this then it would be impossible to provide constant mapping of Date to index, because of need to choose between indices of Dates which have same value. Regarding #3 – well method should be there (https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.visuals.axes.CategoryDateAxis~setBarTimeFrame.html). Maybe you declare xAxis variable as IAxis? This would hide this method, because it isn’t available in IAxis interface.
- You must login to post comments
Hi thanks for your reply
Problem solved
- And Categorydateaxis doesnt support second format?
- Okay, so the best use case for realtime trade is categorydateaxis right?
- here is my code
xAxis = new CategoryDateAxis(DemoActivity.this);
xAxis.setBa
setbarttime & getbartime never exist
- Yuda Susanto answered 3 years ago
- You must login to post comments
Please login first to submit.