for the XamDataChart, what if I need to add more than one YAXis, like one for pressure (left side), one for temperature (right side). How to achieve this? also add the description of the YAXis (pressure or temperature)?
Thanks,
Joan
Hello Joan,
I am just checking your progress on the issue. Please do not hesitate to let me know if you have any further questions.
I have been looking into your post. You create the xmYRightAxis in the XAML code, then bind it to the LineSeries. You can set the following code <ig:LineSeries x:Name="lineSeries1" YAxis="{Binding ElementName=xmYRightAxis}" /> through the code behind as follows: this.lineSeries1.YAxis = xmYRightAxis. Here is a link from our documentation, where you can find more information about adding secondary YAxis. http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/xamDataChart_Multiple_Axes.html. Please do not hesitate to let me know if you have any further questions or I have misunderstood your requirements.
Basically I am asking how to bind to different YAxis depending on the type of data in the lineseries. I realized it can only be done in code behind, like this:
if(pentype.Type == ptPressure)
{
Binding newBinding = new Binding() { Source = xmYRightAxis};
LineSeries1.SetBinding(LineSeries.yAxis, newBinding);
}
the LineSeries.yAxis is not valid property, so there is no dependency property for LineSeries like YAxisProperty, or YAxis?
then how would the XAML binding <ig:LineSeries x:Name="lineSeries1" YAxis="{Binding ElementName=xmYRightAxis}" /> work?
I have been looking into your post and I am not sure that I completely understand your scenario. If you define you axes as follows:
<ig:NumericYAxis x:Name="xmYAxis" Label="{}{}-" StrokeThickness="5" Stroke="Blue">
<ig:NumericYAxis.LabelSettings >
<ig:AxisLabelSettings Location="OutsideLeft" Extent="55" />
</ig:NumericYAxis.LabelSettings>
</ig:NumericYAxis>
<ig:NumericYAxis x:Name="xmYRightAxis" StrokeThickness="10" Label="-{}"
MajorStroke="DarkBlue" MajorStrokeThickness="2"
Stroke="Red">
<ig:NumericYAxis.LayoutTransform>
<RotateTransform
Angle="180"/>
</ig:NumericYAxis.LayoutTransform>
<ig:NumericYAxis.LabelSettings>
<ig:AxisLabelSettings Location="OutsideRight" Foreground="DodgerBlue"/>
You should have two YAxis – one on the right side of the chart and one on the left side. One would show the Temperature and the other – the Pressure.
If I have misunderstood your requirements would you please modify the previous sample I have attached with your functionality in order to be able to identify your issue and provide you with better support. I am looking forward to your post.
how can I set binding to different YAxis depending on the type of my datacontext,
I need to be able to do this in the xaml:
if (Pen.Type=Pressure)
YAxis = "{Binding ElementName=yAxisPressure}"
if(Pen.Type=Temp)
YAxis="{Binding ElementName=yAxisTemp}"
Triggers can only used to set property, not sure about binding.