Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
905
X=Y Line on ScatterSeries Chart
posted

I currently have a XamDataChart which displays a ScatterSeries of points. The chart is intended to be a unity chart, so I'm trying to add a straight diagonal line of X=Y to show how close the actual v estimated data was. I'm having trouble getting a LineSeries to appear on the same chart as a ScatterSeries... are there any examples of this? Additionally, I would like to be able to hover on the ScatterSeries points and have a custom label display, but I can't seem to find the correct properly to bind my label to.

Help appreciated!

Parents
No Data
Reply
  • 34830
    Verified Answer
    Offline posted

    Hello Danielle,

    Thank you for your post!

    A LineSeries is in the Category series family whereas the ScatterSeries is in the Numeric series family. For you to have an X=Y LineSeries in your XamDataChart, you would need to include a separate CategoryXAxis. As an alternative to this, I would recommend that you look into the creation of a ScatterLineSeries. This series is numeric, like the ScatterSeries, except it draws a line between the points. If these points chronologically increase where X=Y, you will have a line that is drawn diagonally in the chart. You may also want to set the MarkerType property on this line to "None" if you only wish to see the line itself.

    Regarding the tooltips, the data context of the elements in your tooltip is a Infragistics.Controls.Charts.DataContext object. This DataContext object has an Item property, which represents the data item that your series represents. So, to bind to a property on this data item, you would need to use {Binding Item.PropertyName}.

    I have attached a sample project to demonstrate the above. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamDataChartXYLineCase.zip
Children
No Data