Hi,
I am trying to display Markers in my chart in such a way that it only apears on cirtain datapoints but not at all data points. Currently I am using line chart and Binding my collection with chart at runtime and maping Xvalue and Yvalue on my chart. But I want to display markers on cirtain XValues not to all Xvalues in mychart . Can anyone suggest me the solution please.
Thanks.
Hi Sam,
Thanks for your reply. Well yes its working to set custom value but I want to show my tool tip value or binded object value. Hope you ill get better idea from the Code given bellow
public static Series MakeSeriesForLabels <T> (T SeriesList, string Labelstring)
{
();
DataMapingBinding.Source = SeriesList;
sr.SetBinding(
Series.DataSourceProperty, DataMapingBinding);
sr.Label = Labelstring;
sr.Fill =
Brushes.Transparent;
sr.ChartType =
ChartType.ScatterLine;
sr.DataMapping =
"ValueX=CurvePointX ; ValueY=CurvePointY; ToolTip= Tenors";
m.Fill =
Brushes.Green;
m.Type =
MarkerType.Star5;
m.Stroke =
Brushes.Black;
m.Format =
"{ToolTip:C}"; // Here I want to display Tenors maped in ToolTip and Tenors is one of my objects property.
sr.Marker = m;
return sr;
}
how can I map my object property Tenors in Marker. Please suggest solution.
Muhammad,
Here is an example to add custom text to a marker in code:
Marker marker1 = new Marker(); marker1.FontSize = 18; marker1.Format = "your text {Value:c}"; marker1.Type = MarkerType.Star5; marker1.MarkerSize = 2; marker1.Fill = Brushes.Red;
//This code assumes you already have a Series with DataPoints[n] or more DataPoints on the chart this.xamChart1.Series[0].DataPoints[5].Marker = marker1;
Adding custom text in xaml requires even less code. Please refer to the following help topic for additional information on customizing markers:
http://help.infragistics.com/NetAdvantage/WPF/current/CLR3.5/?page=xamChart_Working_with_Markers.html
Let me know if you have any question.
Sam
Thanks for reply, Well yes its displaying tooltip but I need to show some custom text in my marker label not the valueX or ValueY. Any other custom value... Can you please suggest a solution in this regard.
The attached sample seems to display toolTips on the markers.
Did you have any ather question?
Sincerely,
Thanks Curtis for your help and assistance.