Hi,
Is there a way of turning off the stroke lines on an axis but retain a line for the axis. For example I've got a numeric Y axis and I want to hide all the stroke lines except for 0 and the same for my X axis.
In my graph the Y axis can go into negative numbers but I'd still like to retain the 0 axis. As sample below:
Kind regards,
Nathan
Thanks Dimitar, that worked brilliant.
Hi Nathan,
Thank you for the reply.
The axes have a CrossingValue property, which determines at what point they will cross with the axis that is specified by the CrossingAxis property. So in order to get the X axis to cross with the Y axis at 0, you could use code like this:
xAxis.CrossingAxis = yAxis;
xAxis.CrossingValue = 0;
Please let me know if you have any additional questions.
Hi Michael,
Thanks for your response. I've implemented your solution and it does work in part. The Y axis is perfect but the X axis starts from the lowest value on the Y axis, as shown in the image below, as opposed to 0. Ideally the X axis would start from the 0 on the Y axis. Is there a way to achieve that?
You can modify the DataChart at design time to access the Axis Collection Editor via the Axis property in the properties window. With each visualization for the series you can set the Alpha for MajorStroke and MiniorStroke to zero to hide the grid lines. You will want strokes to be be same color as your background. Then you can make sure that the Stroke for each axis is a solid black with a higer thickness.
In my image attached you can see that the changes I made are in bold, eg thickness is set to 5. I set the same values for my X and Y axis and achieved the following results.
I also recommend submitting a product idea on our website to properly turn off the just the grid lines without having to modify the stroke appearance objects.