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

RadCartesianChart LineSeries mixed linetype

3 Answers 79 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 02 Dec 2019, 03:14 PM

Hi,

What is the best practice to have a combination of a full line to a dotted line.

I would like to use it in data of last x weeks to a forecast of y weeks. I would like to have a dotted line for the forecast and a full line for the last weeks.

Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 05 Dec 2019, 11:51 AM

Hello Kurt,

If I understand your requirement properly, you want to have two lines in a Cartesian chart. In this case, you can use RadCartesianChart with two LineSeries. To make the one of the series to be dotted, use its DashArray property. For example:

<telerik:LineSeries DashArray="2, 2" />

If this isn't your requirement, can you share a picture of the expected result?

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kurt
Top achievements
Rank 1
answered on 05 Dec 2019, 11:59 AM

Hi Martin,

No, I want to have 1 lineSeries. This Lineseries has 20 values. It starts with the values of the last 10 weeks, followed with the next 10 weeks. The first part is the real measured data, the last part is predicted forecast data. I'm looking in a way to have the second part in a dotted line (because it's virtual).

I tried already to add 2 lineSeries in the same cartesian chart (one with full line and one dotted), but then I get an issue with time scale (mixup)

Thanks in advance for support!

Best regards,

Kurt

0
Accepted
Martin Ivanov
Telerik team
answered on 06 Dec 2019, 01:38 PM

Hello Kurt,

The approach with the 2 LineSeries is the way to go. However, in this if you use a categorical axis you won't get ordered categories. Instead, each category will be added at the time when the first data point with the category enters the chart. I will guess this is your case. If so, you can include a dummy chart series with empty values. This series will contain all expected categories. This way you will ensure that there won't be a mixup of the categories.

Another approach would be to use DateTimeContinuousAxis, if you use date time values.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ChartView
Asked by
Kurt
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Kurt
Top achievements
Rank 1
Share this question
or