I have a report that uses parameters to hide or show data on a chart at runtime. I have the following code to read the parameter and use it to control the visibility of the axes.
((SplineSeriesView)xrChart1.Series[0].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[0].Value);
((SplineSeriesView)xrChart1.Series[1].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[1].Value);
((SplineSeriesView)xrChart1.Series[2].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[2].Value);
((SplineSeriesView)xrChart1.Series[3].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[3].Value);
((SplineSeriesView)xrChart1.Series[4].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[4].Value);
((SplineSeriesView)xrChart1.Series[5].View).AxisY.Visible = Convert.ToBoolean(this.Parameters[5].Value);
Because series 0 and series 1 are both tied to the same axis, I am using an or operator. The problem that I am having is that the axis will not hide when they are both false. This is the code that I am using:
bool zero = Convert.ToBoolean(this.Parameters[0].Value);
bool one = Convert.ToBoolean(this.Parameters[1].Value);
if ((zero = true)||(one = true))
{
((SplineSeriesView)xrChart1.Series[0].View).AxisY.Visible = true;
}
else if ((zero = false) && (one = false))
{
((SplineSeriesView)xrChart1.Series[0].View).AxisY.Visible = false;
}
How can I get the axis to hide? Thank you in advance for your help.