SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

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.

  1. 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.

  2. how to set time frame in date axis like category date axis?

  3. without scichart builder i cannot set time frame in categorydateaxis

Version
4.2.0.4608
  • You must to post comments
1
0

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

  • Yuda Susanto
    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
  • Yura Khariton
    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 to post comments
0
0

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

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.