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. 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>
<ig:ScatterSeries
Title="Series 1"
MarkerType="Triangle"
ItemsSource="{Binding Data}"
YMemberPath="Value1"
XMemberPath="Index"
XAxis="{Binding ElementName=xAxis}"
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>
<ScaleTransform
ScaleY="-1"
CenterY=".5"/>
</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).
Please let me know if you need any further assistance on the matter.
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. 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>
</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:
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.
I am just checking if you require any further assistance on the matter.
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