Hi,
I have a Line chart where I map XValue and YValue using a class as the ItemSource. My problem is that the X Axis is always scaled as if the axis should be a category axis (i.e., point 1 plots at tickmark 1, point 2 plots at tickmark 2 etc.).
What I need to plot is a scatter plot, i.e. point 1 with value 5 plots at x=5 and not x=1, point 2 with value 8 plots at x=8 and not x= 2.
The code is as follows:
with clsPLotData being this:
The chart produced is attached as a jpg. How coan I get the x axis to show data from 5 to 14 instead of point 1 to 4?
thanks,
Anne
I have a Line chart where I map XValue and YValue using a class as the ItemSource. My problem is that the X Axis is always scaled as if the axis should be a category axis (i.e., point 1 plots at tickmark 1, point 2 plots at tickmark 2 etc.).
What I need to plot is a scatter plot, i.e. point 1 with value 5 plots at x=5 and not x=1, point 2 with value 8 plots at x=8 and not x= 2.
The code is as follows:
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new LineSeriesDefinition();
seriesMapping.ItemMappings.Add(new ItemMapping("AODate", DataPointMember.XValue));
seriesMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
seriesMapping.ItemMappings.Add(new ItemMapping("Label", DataPointMember.Label));
ctlRadChart.SeriesMappings.Add(seriesMapping);
List<
clsPlotData
> data = new List<
clsPlotData
>();
double minX = 5;
double middleX = 8;
double middle2X = 9;
double maxX = 14;
double minY = 1;
double middleY = 3;
double middle2Y = 8.5;
double maxY = 2;
data.Add(new clsPlotData(minX, minY, ""));
data.Add(new clsPlotData(middleX, middleY, ""));
data.Add(new clsPlotData(middle2X, middle2Y, ""));
data.Add(new clsPlotData(maxX, maxY, ""));
ctlRadChart.ItemsSource = data;
with clsPLotData being this:
public class clsPlotData
{
public clsPlotData(double AOdate, double yValue, string label)
{
this.YValue = yValue;
this.AOdate = AOdate;
this.Label = "X: " + AOdate.ToString() + "\nY: " + yValue.ToString();
}
public double YValue
{
get;
set;
}
public Double AOdate
{
get;
set;
}
public string Label
{
get;
set;
}
}
The chart produced is attached as a jpg. How coan I get the x axis to show data from 5 to 14 instead of point 1 to 4?
thanks,
Anne