I'm trying to display multiple series in a single chart but it seems to be giving me trouble on the xAxis. Basically, if I have 2 series that represent the same data; one in single increments and the second in multiples of 2, how can I get them to both show up on the same grid and respect a universal unit marker on the xamChart? For example, if I have 2 collections similar to the ones below along with the snippet of xaml for the X axis, how can I have them follow the first second set's units without it trying to squeeze the first set's information over between the crosshairs?
int[] firstSeries = { 1, 2, 3, 4, 5, 6 };
int[] secondSeries = { 2, 4, 6 };
..and xaml:
<
igCA:Axis AxisType="PrimaryX" Unit="2" Stroke="LightGray">
<igCA:Axis.Label>
<igCA:Label Foreground="LightGray"/>
</igCA:Axis.Label>
<igCA:Axis.MajorTickMark>
<igCA:Mark Stroke="LightGray"></igCA:Mark>
</igCA:Axis.MajorTickMark>
</igCA:Axis>
TIA
Hi,
What kind of series are you using in this case, something like line series? Or something like column series?
-Graham
I'm actually using the generic series in the Infragistics.Windows.Chart.Series namespace and setting it in code behind. Something similar to the code below:
Series series = new Series();
series.ChartType = ChartType.Line;
series.StrokeThickness = 0.25;
series.DataMapping = "Value=Values;ToolTip= TOOLTIP";
series.DataSource = set;
series.Animation = animate;
xamChart1.Series.Add(series);
So I'm starting to wonder if I'm using the wrong series in the wrong namespace. If I use that code in two different series with the data previously mentioned, would it squeeze the first series with the [0, 2, 4, 6] over the hashmarks of the second with the [0, 1, 2, 3...]? I guess the question is: is there a way to configure the xAxis by series or is this something only available in the xamDataChart?
You have a way of adding a secondary x axis to use for the second series, but if you have more than 2 series what you may need to do is align the data. The line series assumes your x data maps to categories, and that each series used on the same x axis will have the same number of categories (rows). So your data will be misaligned if your series data arrives at different intervals. You may need to pad out the second series so that it has the same number of values as the series with more values.
Another option is to use a ScatterLine type series instead, and specify an x value equal to where you want each point to display, so you can make the approparite points line up with each other.
Does this help?
see this for more info on aligning data series:
http://community.infragistics.com/forums/p/38082/220246.aspx#220246
note though, that the situation is different with a line chart, you wouldn't want to pad a line chart with 0 values, necessarily. You may want to pad the data with an interpolated value between the two.
see here more more information about SecondaryX axis:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamChart_About_Axes.html
I'm starting to think that i'll need to pad my data to make the amount of values match. Ideally, I could get the scatterline method to work if it could only work in conjunction with another series type. The small curveball that I left out is that the current real-time scenario currently has 2 series of data at hourly intervals that i'm displaying for the entire day with a stackedcolumn and line series. The third I'm wanting to add is an additional line series with data at 5 minute intervals for the entire day. There's no way to work in a scatterline series with with a stacked column, is there?