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.
Unfortunately, activation email could not send to your email. Please try again.

LineSeries with multiple DataMarker color

Thread ID:

Created:

Updated:

Platform:

Replies:

120844 Oct 21,2015 12:00 PM Oct 23,2015 09:07 AM Xamarin.Forms 3
loading
Tags: SfChart
Marco
Asked On October 21, 2015 12:00 PM

Hi,

Sorry if the question seems trivial, this is the first day that I'm using your product and I'm evaluating it before proceeding with the purchase.

I need a LineSeries with different colors for the markers (is a temperature graph).

Below a certain threshold i should have a color (let say green), over this threshold and below another i should have another color ((let say orange) and over this threshold I should have another color (let say red)

Is it possible to obtain this result with graph?


Another question: is it possible to have an horizontal line which represents the average of the temperatures?

Thank you!

Marco

Manivannan Elangovan [Syncfusion]
Replied On October 22, 2015 06:48 AM

Hi Marco,

Thanks for using Syncfusion products.

Query1:I need a LineSeries with different colors for the markers

We are able to achieve your requirement by using ValueToPoint method in the chart and AbsoluteLayout in the Xamarin forms. We have prepared a workaround sample based on your requirement..

Query2:Is it possible to have an horizontal line which represents the average of the temperatures?

We are able to achieve your above requirement by using StripLines. Please find the following code example which shows how to define the striplines in axis.

Code Example:

NumericalAxis numaxis = new NumericalAxis ();
chart.SecondaryAxis = numaxis;
NumericalStripLine strip1 = new NumericalStripLine ();
strip1.Start = 22;
strip1.Width = -7;
strip1.FillColor = Color.Green;
strip1.IsPixelWidth = true;
strip1.Text = "Low Temperature";
numaxis.StripLines.Add (strip1);

Sample: DataMarker

Note: We have used BoxView instead of datamarker symbols. Write Custom renderer for the different datamarker symbols.

Regards,
Manivannan.E
 

Marco
Replied On October 22, 2015 07:11 AM

Hi,

thank you for your reply and your example.

The NumericalStripLine works very well, on this just one question for curiosity: why the row "strip1.Width = -7" ?
About the second point, my graph has EnablePanning set to true, so the BoxView method doesn't work.
Do you have any other workaround?

Thank you!

Marco

Manivannan Elangovan [Syncfusion]
Replied On October 23, 2015 09:07 AM

Hi Marco,

Query1: why the row "strip1.Width = -7" ?

StripLines are rendered based on Start and Width property values. If the value of width is positive means striplines render upwards from the start property value, if negative means render downwards from the start value.

Query2: my graph has EnablePanning set to true, so the BoxView method doesn't work.

We have modified the workaround sample based on your requirement. Please download the sample from the following location.

Sample: Datamarker

Regards,
Manivannan.E

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;