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,
Thank you for your post. I have been looking into it and have created a small sample for you, named SecondaryYAxis. In the sample there are two LineSeries and for each of them there is a separate YAxis. For your second requirement I create a small legend describing the two series, place on the outside right position of the xamDataChart. Please refer to the attached sample and feel free to let me know if you require any further assistance on the mater.
Thank you for the sample. It's really helpful. but how to add a label for the YAXis? where to position it?
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.
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. 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.
I am just checking your progress on the issue. Please do not hesitate to let me know if you have any further questions.
Thank you! Set lineseries1.YAxis = xmYRightAxis works.
but now I have 2 sets of Grid on the chart since there are different ranges for the YAxis.
I tried to set the MajorStrokeThickness="0" to one of the YAxis, but then if the other YAxis is not show, none of grid is shown.
Is there an easy way to let xamChart do that?
I am just checking your progress on the issue. Please do not hesitate to let me know if you have any further questions on the mater.
Thank you for the post. I it normal when you have two Y axis to have two scales. One scale for each axis. I have modified the previous sample I have sent. In the modified sample I have added a button. On the click event of the button I am hiding the right Y axis. From the sample you can see that when the right Y axis is hidden the strokes are hidden together with the axis.Please find the attached sample and feel free to let me know if you have any further questions on the mater.
xamChart is the xamDataChart. the grid I mean is the scale grid which is drawn by majorstorkethickness and minorstrokethickness.
Thank you for the post. I have been looking into it and I am not sure I understand you scenario. How is the grid you mentioned related with the chart and what chart are you using? In you first post you mentioned xamDataChart and in the last - xamChart. Having the answers to those questions will help me understand your scenario better. Thank you in advance for the cooperation.
I have attached a small sample, named SecondaryYAxis.zip, would you please modify the attached sample with your functionality in order for me to be able to reproduce your issue and provide you with better support. I am looking forward to your post.