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

To display dotted lines using LineSeriesDefinition

15 Answers 108 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Manishkumar
Top achievements
Rank 1
Manishkumar asked on 31 Oct 2011, 01:47 PM
Hi;
We have an unsual requirement that using line series defination
We have to display half line solid and towards end dotted line
as shown in the attachment.
Please let me know how can i achive this functionality as
we have a client demo on 2/11/11

15 Answers, 1 is accepted

Sort by
0
Manishkumar
Top achievements
Rank 1
answered on 01 Nov 2011, 08:12 AM
Hey ;
please provide some solutions for my above post
0
Sia
Telerik team
answered on 01 Nov 2011, 09:22 AM
Hi Manishkumar,

Unfortunately this is not possible. The only possible workaround is to use two different line series for the normal and the dashed line.

Please excuse us for the inconvenience caused.
Kind regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Manishkumar
Top achievements
Rank 1
answered on 01 Nov 2011, 10:19 AM
Hi;
Can I atleast show the box with some value as shown in the UI.
If this is possible please provide me with sample code
0
Sia
Telerik team
answered on 02 Nov 2011, 12:55 PM
Hi Manishkumar,

As I said in the other forum thread opened by you, we need clarification about the technology which you use in your application.

Thank you in advance,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Manishkumar
Top achievements
Rank 1
answered on 03 Nov 2011, 11:06 AM
Hi sia;
It is in Silverlight and in that we are generating charts.
In other formum I have posted only to get Quick response.Since I was running out of time
Thanks in Advance for your response.
Please  reply ASAp.
0
Sia
Telerik team
answered on 08 Nov 2011, 01:10 PM
Hello Manishkumar,

You can have a canvas over RadChart and position additional elements there. Unfortunately there is no built-in support for labels as the one shown in your screenshot.

I think that these methods could be of interest of you:
- ConvertDataUnitsToPhysical
- ConvertPhysicalUnitsToData

Greetings,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Manishkumar
Top achievements
Rank 1
answered on 10 Nov 2011, 08:33 AM
HI;
I have tried to display label using smart label property by taking help from this link
http://www.telerik.com/help/silverlight/radchart-features-smart-labels.html

But my problem is that the label is displayed with background grey colour and in white font.
how can i customiize this label to white colour background and red colour font or white colour font
with red background.
Please find the attachment for more details
please reply ASAP as we have go live tommorrow.
0
Sia
Telerik team
answered on 10 Nov 2011, 10:02 AM
Hi Manishkumar,

Please send us a sample project showing your implementation so that we can modify it for you.

Thank you,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Manishkumar
Top achievements
Rank 1
answered on 11 Nov 2011, 08:07 AM
HI
Please find the sample code

 

 

Style lineStyle4 = new Style(typeof(Telerik.Windows.Controls.Charting.SelfDrawingSeries));

 

lineStyle4.Setters.Add(

 

new Setter(SelfDrawingSeries.BorderLineStyleProperty, pathStyle4));

 


 

 

Style pathStyle4 = new Style(typeof(System.Windows.Shapes.Path));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeDashArrayProperty, "3"));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Purple)));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeThicknessProperty, 1));

 


 

 

LabelSettings settings = new LabelSettings() ;

 

settings.Distance = 10;

settings.ShowConnectors =

 

true;

 

dSeries8.Add(

 

new Telerik.Windows.Controls.Charting.DataPoint() { YValue = data6[data6.Length - 1 - lintcount - 1], XCategory = xlabel[data6.Length - 1 - lintcount - 1] });

 

 

 

 

dSeries8.Definition =

 

new LineSeriesDefinition() { SeriesStyle = lineStyle4, LabelSettings = settings, ShowPointMarks = true, AxisName = "Percentage"};

 

 

dSeries8.Definition.Appearance.Stroke =

 

new SolidColorBrush(Colors.Red);

 

dSeries8.Definition.AxisName =

 

"Percentage";

 

dSeries8.Definition.ItemLabelFormat =

 

"#VAL{P2}";

 

dSeries8.Definition.ItemToolTipFormat =

 

"#VAL{P2}";

 

radchartarea.DataSeries.Add(dSeries8);

radchartarea.SmartLabelsEnabled =

 

true;

 


Please find. Please Reply it as we have Go-Live on Monday and we need to do ASAP

0
Manishkumar
Top achievements
Rank 1
answered on 11 Nov 2011, 08:09 AM

 

 

Please find the below code snippet as we have go-live on monday
Please reply ASAP

Style
pathStyle4 = new Style(typeof(System.Windows.Shapes.Path));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeDashArrayProperty, "3"));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeProperty, new SolidColorBrush(Colors.Purple)));

 

pathStyle4.Setters.Add(

 

new Setter(Shape.StrokeThicknessProperty, 1));

 



 

 

Style lineStyle4 = new Style(typeof(Telerik.Windows.Controls.Charting.SelfDrawingSeries));

 

lineStyle4.Setters.Add(

 

new Setter(SelfDrawingSeries.BorderLineStyleProperty, pathStyle4));

 

dSeries8.Add(

 

new Telerik.Windows.Controls.Charting.DataPoint() { YValue = data6[data6.Length - 1 - lintcount - 1], XCategory = xlabel[data6.Length - 1 - lintcount - 1] });

 

RadChart1.DefaultView.ChartArea.SmartLabelsEnabled =

 

true;


 

dSeries8.Definition =

 

new LineSeriesDefinition() { SeriesStyle = lineStyle4, LabelSettings = settings, ShowPointMarks = true, AxisName = "Percentage"};

 

 

dSeries8.Definition.Appearance.Stroke =

 

new SolidColorBrush(Colors.Red);

 

dSeries8.Definition.AxisName =

 

"Percentage";

 

dSeries8.Definition.ItemLabelFormat =

 

"#VAL{P2}";

 

dSeries8.Definition.ItemToolTipFormat =

 

"#VAL{P2}";

 



radchartarea.DataSeries.Add(dSeries8);

radchartarea.SmartLabelsEnabled =

 

true;

 

0
Manishkumar
Top achievements
Rank 1
answered on 16 Nov 2011, 06:45 AM
Hey;
Please reply to this ASAP
0
Sia
Telerik team
answered on 16 Nov 2011, 01:03 PM
Hello Manishkumar,

Please excuse us for the late reply.

You can use the following style and set it as SeriesItemLabelStyle to the Line series definition:
<Style x:Key="CustomLabel" TargetType="telerikCharting:SeriesItemLabel">
    <Setter Property="Foreground" Value="Red" />
    <Setter Property="Fill" Value="White" />
</Style>

I hope this helps.

Regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Manishkumar
Top achievements
Rank 1
answered on 22 Nov 2011, 08:41 AM
Hi Sia;
Thanks for your reply.

dSeries8.Definition.Appearance.Foreground =

 

new SolidColorBrush(Colors.Red);//Label Backgroud Color

 

when i apply this then it does not work. Nor it colour get change can u pls suggest any other way to change the font color..
and also we have one more requirement that Is it possible to display PointMarks on the lineserries in small dot.
As shown in the attachment.Since when I use this property ShowPointMarks = true .
It displays in big Dots.
Please Reply ASAP as we are having GoLive on Monday
0
Manishkumar
Top achievements
Rank 1
answered on 23 Nov 2011, 06:32 AM
Hi sia;
can u please reply to above post.
We need to implemenent very soon as we have Go-Live on Monday
Thanks in Advance
0
Evgenia
Telerik team
answered on 24 Nov 2011, 11:19 AM
Hi Manishkumar,

  Take a look at our help topic where it is described how to cuztomize the PointMarks via templating the PointMark control. For the purpose you'll need to change the Size property's value which is set to 10 by default in the PointMarkStyle.

Regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Manishkumar
Top achievements
Rank 1
Answers by
Manishkumar
Top achievements
Rank 1
Sia
Telerik team
Evgenia
Telerik team
Share this question
or