Attachment: ChartDemo_49707e39.zip
|
chart.Delegate = new ChartDelegate();
…
private void Button_TouchUpInside(object sender, EventArgs e) {
chart.PrimaryAxis.AutoScrollingDelta = 10;
}
public class ChartDelegate : SFChartDelegate
{
public override void DidPan(SFChart chart, SFChartPanInfo info)
{
info.Axis.AutoScrollingDelta = double.NaN;
}
} |
|
SFCategoryAxis primaryAxis = new SFCategoryAxis();
primaryAxis.ShowMajorGridLines = false;
primaryAxis.AutoScrollingDelta = 6;
primaryAxis.AutoScrollingMode = ChartAutoScrollingMode.End;
primaryAxis.Interval = new NSNumber(1);
…
private void ChartDelegate_PanAction(SFChartPanInfo panInfo)
{
isScrolling = true;
var range = chart.PrimaryAxis.VisibleRange;
var end = range.End;
var count = dataModel.Count - 1;
//Start scrolling afer panning again right end when reach near last before index
if (end >= count - 2)
{
isScrolling = false;
}
} |
HiSuggest a reply Devakumar Dhanapoosanam,
Thank you so much for your instant support.
It works like a charm. Really nice...!
But I have a small concern that why the left most label of x-axis is sometimes blinking during live-data?
(Please my attached screen recording for more details)
Could you please help me clarify this and show me how to fix it this?
Regards,
Duc Dang Manh
Attachment: xaxis_lable_blinking.mov_94e5eb00.zip
Hi Devakumar Dhanapoosanam,
CC: Syncfusion team,
After some testing with your provided modified on my previous Chart sample, I detect an urgent problem which related to the scrolling to view history of live-data of the Chart as following:
Source code of sample is in attachment.
Steps to reproduce:
- Step 1: Extract my below attached sample and start the sample app.
- Step 2: Wait for a while to let the chart live-data for about 20 seconds (just to make sure we have more data in history).
- Step 3: Scroll to the left side to view history => The chart will immediately stop live-data.
- Step 4: Scroll back to the right side (when it reaches latest data point).
Issue:
- When the chart.PrimaryAxis.VisibleRange.End reaches the latest data point on the right side, the chart does NOT draw new data point anymore. I always have to single touch on the chart to make it live-data back to work.
Note that, I did not check your previous suggested following code:
//Start scrolling afer panning again right end when reach near last before index
if (end < count - 2){ .... }
because we will not see the live-data resume again when scrolling reach to points near the above point on the right side.
Please help me fix this issue right into my sample.
Many thanks,
Duc Dang Manh
Attachment: ChartPanGestureIssue_82bcb705.zip
|
private void ChartDelegate_PanAction(SFChartPanInfo panInfo)
{
//Start scrolling afer panning again right end when reach near last before index
if (Math.Round((1 - panInfo.Axis.ZoomFactor), 3) == Math.Round(panInfo.Axis.ZoomPosition, 3))
{
Console.WriteLine("REACH !!! LIVE-DATA RESUME");
dataModel.IsLiveDataEnabled = true;
panInfo.Axis.AutoScrollingDelta = 6;
}
else
{
Console.WriteLine("LIVE-DATA SUSPENDED");
dataModel.IsLiveDataEnabled = false;
panInfo.Axis.AutoScrollingDelta = double.NaN;
}
} |