Everyone,
I'm working on a xamdatachart that would need to chart two series (common x axis but two y axes). I'm using the following xaml code but I can't seem to figure out the background code to accomplish this.
<
="True">
>
="yAxis" />
="xmYAxis">
<!--MinimumValue="100"
MaximumValue="10000">-->
="#FF69177C"
="12"
="Center"
="OutsideRight"
=Value}"
=Value}" />
="{}{Label}"/>
="2" />
="PriceSeries"
="Candlestick"
="ModifiedAverage"
}"
="Open"
="Close"
="High"
="Low"
="Volume"
=commonXAxis}"
=priceYAxis}">
</ig:XamDataChart.Series>
So, I've got two NumericYaxes which I'm guessing would let me chart two series but I can't seem to figure out how to accomplish it. When I try to add the second series, the chart only charts the second and ignores the second series. This is the code behind:
var data = from row in backtestTable
.Rows.OfType<
DataRow>()
select new DataItem()
{
Label = (
string)row["Date"].ToString(),
Value =
double.Parse(row["Price"].ToString())
};
backtestChart.DataContext = data;
data =
from row in backtestTable
double.Parse(row["Sales"].ToString())
backtestChart.Series[
"Test"].DataContext = data;
I would really appreciate any help.
Thanks,
K
It would be very useful if "series of all equal length and interval" was not a requirement. XY charts tend to be technical data and you may have a different sampling interval, points get thrown out, or points are not collected. To make the chart work you then have to massage your data to try to meet this requirement.
I experienced the very same thing when I first tried to use the chart and it took a while to figure out what was going on.
Sorry to revive this old thread - but I am beating my head against the wall on a similar issue.
We use these controls in a generic system, where the user can define his / her own charts using the generic data and layouts. In XamChart we had the ability to define multiple series on a chart quite happily, using completely disparate object sets per series. It seems to me that in the XamDataChart, this is not possible, as the bindings only cater for one (CategoryDateTime) X-axis, with the Y-axis values for different series coming from different properties from the SAME X-Axis DataContext?
In other words, using ChartDataPoint definitions as follows would simply not work if you have a collection of these for each series?
(simplified)
class MyDataPoint { object XAxisValue; object YAxisValue; }
You CAN ONLY define multiple series on one shared CategoryDateTimeXAxis using an object that looks like this:
class YourDataPoint { object XAxisValue; object YAxisValueSeries1; object YAxisValueSeries2; ...etc. }
Please let me know what you think - and for the love of all that is sweet and beautiful, correct me if I'm wrong, or give me an example of how I can use the first object and not have to use the second?
Thank you very much!