Hi i have a scatter plot in a WPF application through XamDataChart which contains a "Circle" Marker. I have set the Marker Brush,Marker Outline properties, but, How to set the size of the Marker, say to 10pt of MSExcel 2003. Can anyone help me in this?
Hello Srinivas,
Thank you for your post. I have been looking into your question and you can use the MarkerStyle property of the ScatterSeries. You can create a style for the Marker and add setters for the Width and Height properties and after doing so, you can set the that style to the MarkerStyle property. I have created a sample application for you, that shows how you can implement this approach.
Please let me know if you need any further assistance on the matter,
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you very much Mr.Krasimir. This problem has been solved.
Thank you for your reply. I am very glad that the approach I have suggested, helped solving your issue. Please let me know if you need any further assistance on the matter,
Hi Krasimir, I have another issue regarding the Marker of the scatter plot. I hav set Triangle marker for a plot. Actually it is coming out to be an inverted Triangle(base-topped). How can i invert it to make look as actual trianlge?
Thank you
Thank you for your reply. I have been looking into your question and I can suggest setting the LayoutTransform property of the Marker to a ScaleTransform. You can set the ScaleY of the ScaleTransform to -1 to flip the triangle and the CenterY to .5, so the rotation will start from the center of the triangle. I have modified the sample application that I have previously sent, in order to show how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Hi Thank you for you reply,
Please can you provide me the code of the solution you said. How to set LayoutTransform to ScaleTransform. Aplogies for the inconvinience,I am new to WPF.
Awesome Krasimir...it worked...Thank you so much..Sorry for late reply..I was off work a while...I will let you know for further issues...Once again Thank you so much..:)
Srinivas STP
I am just checking if you require any further assistance on the matter.
Thank you for your reply. I have been looking into your question and you can use the LegendItemTemplate property of the series. You can create a data template which will be used in the Legend of the XamDataChart. In the DataTemplate you can rotate the rectangle, by using ScaleTransform, as in the Marker style. Here is how the DataTemplate for the LegendItem can be defined:
<Grid.Resources>
<DataTemplate x:Key="LegendItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5">
<ContentPresenter Content="{Binding}" Margin="5,0,5,0"
ContentTemplate="{Binding Series.LegendItemBadgeTemplate}" >
<ContentPresenter.LayoutTransform>
<ScaleTransform
ScaleY="-1"
CenterY=".5"/>
</ContentPresenter.LayoutTransform>
</ContentPresenter>
<ContentPresenter Content="{Binding Series.Title, TargetNullValue=Series Title}"
Margin="0,0,5,0" />
</StackPanel>
</DataTemplate>
</Grid.Resources>
After defining the data template, you can assign it to the LegendItemTempalte property of the series as follows:
<ig:ScatterSeries
Title="Series 1"
MarkerType="Triangle"
ItemsSource="{Binding Data}"
YMemberPath="Value1"
XMemberPath="Index"
XAxis="{Binding ElementName=xAxis}"
YAxis="{Binding ElementName=yAxis}"
LegendItemTemplate="{StaticResource LegendItemTemplate}">
…….
I have modified the sample application that I have created for you, in order to show how you can implement this approach.
Thank you Mr.Krasimir, It worked for the graph. But in the Legend still the traingle looks inverted. How can i change in Legend also.
Thank you for your reply. You can add a setter for the LayoutTransform in the style for the MarkerStyle property of the series. Here is the xaml code for setting the LayoutTransform:
<ig:XamDataChart.Series>
YAxis="{Binding ElementName=yAxis}">
<ig:ScatterSeries.MarkerStyle>
<Style TargetType="{x:Type ig:Marker}">
<Setter Property="Width" Value="{Binding MarkerWidth}"/>
<Setter Property="Height" Value="{Binding MarkerHeight}"/>
<!-- Setting the LayoutTransform to rotate the rectangles -->
<Setter Property="LayoutTransform">
<Setter.Value>
</Setter.Value>
</Setter>
</Style>
</ig:ScatterSeries.MarkerStyle>
</ig:ScatterSeries>
</ig:XamDataChart.Series>
Also you can find the example for that in the sample application that I have attached with my previous reply (MarkerSize_1.zip).