This is a migrated thread and some comments may be shown as answers.

plot lines or bands on scatter charts?

12 Answers 501 Views
Charts
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 28 Nov 2014, 11:45 AM
I would like to draw a line parallel to the X axis on a scatter chart at the average of the Y values.  I see plot bands listed for other types of charts, but nothing for scatter charts.  For run, I tried adding a plotBands config to the yAxis element of my scatterline chart, but nothing shows up.

Is there a plot line feature available for scatter charts?

I didn't see anything in the documentation:
http://demos.telerik.com/kendo-ui/scatter-charts/index

12 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 01 Dec 2014, 10:54 AM
Hi John,

I tested the plotBands feature with Scatter Chart and everything is working as expected on my side. Could you please take a look at this dojo and let me know if I am missing something?

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 02 Dec 2014, 06:24 AM
The example you gave works, thank you!

I think my problem was that if you don't specify the color, or you make the value range too narrow, nothing shows up.  I wanted a line and I wanted it to use an appropriate color to the theme (iOS or Android).

I was able to adjust my code to approximate a line by dividing the maximum value plotted by the chart height.  Unfortunately, this doesn't work completely because the Y axis extents adjust to the next round label value.  Is there a more elegant way to get a "line"?

Here's one of the charts I draw (the Y values vary by several orders of magnitude):
http://dojo.telerik.com/iFuWe
0
Iliana Dyankova
Telerik team
answered on 03 Dec 2014, 03:19 PM
Hi John,

In my opinion the used approach with plotBands is OK. Could you please elaborate a bit more on the exact outcome you would like to achieve? 

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 03 Dec 2014, 07:16 PM
I would like to draw a line at the average Y value (see the attachment).

The plot band feature marks out a region of Y values, but I want to draw a line of the same width as the primary "scatterline" line.  As you can see in the image, the line is fuzzy not precise like the graph line.  Also, its width varies because I have to estimate the Y value range that corresponds to the graphed thickness (and don't have the dimensions of the padding around the graph, etc).
0
Iliana Dyankova
Telerik team
answered on 05 Dec 2014, 08:09 AM
Hi John,

I was thinking on this case and would suggest to add a second scatterLine series with equal values and hide its markers. For your convenience I prepared a basic example - please check it and let me know if this fits the current requirements.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 05 Dec 2014, 09:24 AM
Having trouble attaching files, here's another try...
0
Accepted
Iliana Dyankova
Telerik team
answered on 05 Dec 2014, 01:50 PM
Hi John,

Please check this example - it demonstrates how to achieve the illustrated outcome using the approach from my previous post.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
John
Top achievements
Rank 1
answered on 05 Dec 2014, 02:12 PM
Setting the X max value works, although it does mean I need to reproduce some of the logic of the normal axis scaling, since my X values also vary widely.

This is a sufficient work-around for now.  Thanks for all the help.
0
Srinivas
Top achievements
Rank 1
answered on 15 May 2020, 01:13 PM

Hi Kendo Team,

My requirement is similar, but could not figure out how to do it.

My Requirement:

1. Scatter chart with some points

2. Draw a line for median (not necessarily horizontal)

3. Draw a line standard deviation (not necessarily horizontal)

 

is this possible?

0
Srinivas
Top achievements
Rank 1
answered on 15 May 2020, 01:16 PM
example in the attached pic
0
Alex Hajigeorgieva
Telerik team
answered on 19 May 2020, 10:33 AM

Hello, Srinivas,

The approach that my colleague Iliana has offered is still valid for non-horizontal lines.

You can take a look at this how-to add a trend line article and let us know in case you have further questions:

https://docs.telerik.com/kendo-ui/knowledge-base/chart-add-trend-line

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Srinivas
Top achievements
Rank 1
answered on 19 May 2020, 10:41 AM

Hello Alex,

Thank you for the reply. Actually I have created a new thread for my problem at 

https://www.telerik.com/forums/mapping-of-chart-data-points-and-actual-coordinates

could you please look at my problem there.

 

thanks,

Srinivas

Tags
Charts
Asked by
John
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
John
Top achievements
Rank 1
Srinivas
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or