We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Scroll as Selection & Dotted Line Series

Hi there, 

I would like to ask if there is a way to do something like scroll to select in the chart. For example, when the chart is being scrolled by user,  whichever column that appears to be in the middle of the screen will be selected automatically. 

Also, I would like to know if there is a way to change the line series into the dotted line.

Thanks.

9 Replies

YP Yuvaraj Palanisamy Syncfusion Team June 8, 2015 01:07 PM UTC

Hi Ken,

Thanks for using Syncfusion products.
#1) We can achieve your requirement by using zoom pan behavior and selection behavior. Also we have prepared an sample for your reference, in that sample we have hooked the Scroll event of Chart and finding the center data chart point index while scrolling and set the calculated data point index to SelectedDataPointIndex of series.


Please find the sample from the following location.


Sample: http://www.syncfusion.com/downloads/support/forum/119339/ze/Scroll-selection894124527

Note: Currently there are some issue in WP, we will fix it our upcoming volume 2 release which is scheduled to release by end of June 2015.


#2) Also, I would like to know if there is a way to change the line series into the dotted line.
You can achieve this using FastLineSeries, please refer the following code snippet. Currently this will not work in Android and iOS, we will fix this issue in our upcoming volume 2 release which is scheduled to release by end of this June 2015.
 
[c#]
FastLineSeries series = new FastLineSeries();
Series.StrokeDashArray = new double[2]{3, 4};

Please let us know if you require further assistance on this.


Thanks,
Yuvaraj P



KW Ken Wong June 9, 2015 02:05 AM UTC

Hi Yuvaraj,

Thanks for the quick reply, the given solution for the scroll selection worked like charms. However, I have couple more of questions which require your assistance.

First of all, is there a way to snap one of the nearest columns to the center point? For instance, when the users scroll the chart, one of the columns must be in the center as selection.

Secondly, is it possible to put a label on top of a line series stating its YValue as a value indicator? 

That's all for my question. Thanks in advanced. 

Thanks once again. 






YP Yuvaraj Palanisamy Syncfusion Team June 9, 2015 06:09 PM UTC

Hi Ken,
#1) Is there a way to snap one of the nearest columns to the center point? For instance, when the users scroll the chart, one of the columns must be in the center as selection.
We are glade to let you know that we have achieved your requirement in Android, but we found some difficulty to achieve the same behavior in iOS. We will update you the possibility in iOS within two business days (June 11, 2015). We have used custom ChartZoomPanBehavior to snap nearest data point index. Please find the sample from the following location,

Sample : http://www.syncfusion.com/downloads/support/forum/119339/ze/Scroll-2097276824
 
#2) Is it possible to put a label on top of a line series stating its YValue as a value indicator?
Yes, it is possible to put the data marker label on top of the series using following code snippet,

C#

series.DataMarker = new ChartDataMarker();
series.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Center;
series.DataMarker.ConnectorLineStyle.ConnectorHeight = 10;
series.DataMarker.ConnectorLineStyle.StrokeColor = Color.Transparent;


Note : By default label will arrange smartly at top or bottom position based on the line intersection angle.
 
Please let us know if you require further assistance on this.
 
Thanks,
Yuvaraj


KW Ken Wong June 10, 2015 03:19 PM UTC

Hi Yuvaraj,

The first solution is working great, it really helps me a lot. Hopefully, you could update me the possibilities on IOS as soon as possible. 

As for the second solution, it seems like the result that I've obtained is the data label being shown on the connector itself. Is there a way to make the label to be shown above the line and fix it to the end of the chart as I'm having the line series as part of the separator/indicator showing that this is the mean/average/center of the YValues.

Or maybe, can I get the Y coordinate of the line series? 

Thank you very much for the help and sorry for the trouble once again.

Thanks,
Ken Wong







YP Yuvaraj Palanisamy Syncfusion Team June 11, 2015 01:24 PM UTC

Hi Ken,

We are glad to let you know that we have achieved your requirement by a workaround. In the workaround sample we have written customer renderer for each platforms to customize the individual data marker labels. The DataMarkerLabelCreated event which we have declared in ChartExt class used to get the notification when the new data marker label created, using this event we have collapsed all the data marker labels except last one which shows the value of current line. Please find the workaround sample from below location.

Sample: http://www.syncfusion.com/downloads/support/forum/119339/ze/CustomLabel-1887440552

Sample image: http://www.syncfusion.com/downloads/support/forum/119339/ze/LineSeries-112403054

Please let us know if you require further assistance on this.

Thanks,
Yuvaraj P


YP Yuvaraj Palanisamy Syncfusion Team June 12, 2015 07:09 AM UTC

 Hi Ken,

We have created a support incident under your account to track the status of snap selected segment in iOS.

Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Please let me know if you require further assistance on this.

Thanks,
Yuvaraj


KW Ken Wong June 13, 2015 12:06 PM UTC

Hi Yuvaraj,

As usual, the given solution is working very well. 

Thank you very much for your assistance and sorry for the troubles. 

Thanks,
Ken Wong


YP Yuvaraj Palanisamy Syncfusion Team June 13, 2015 01:01 PM UTC

Hi Ken,

Thanks for the update.

Please let us know if you require further assistance, we are happy to assist you.

Thanks,
Yuvaraj P


KW Ken Wong June 15, 2015 04:45 AM UTC

Hi Yuvaraj,

Is it possible for us to do a line break on the Primary Axis Label?

Thanks,
Ken Wong

Loader.
Live Chat Icon For mobile
Up arrow icon