I actually replied to this post:
but I think the support team probably won't open that post.
Questions for David: (Of course, answers from anyone are welcome.)
[Infragistics] David Negley:
"that is correct. however, in WinForms and ASP.NET you could implement a custom solution for this using a custom layer or the FillSceneGraph event. it would be tricky, but basically you can redo the labels on one axis, and resize/reposition the data in the chart layer.
another way to approach this would be to modify the data (multiply all the values by -1) and just use IRenderLabel to change the axis labels so it appears values on a reverse scale are being plotted."
======================================
Great idea. I've implemented the second approach successfully.
My first thought was to reverse the x-axis RangeMin and RangeMax in FillSceneGraph event handler like this:
IAdvanceAxis xx = (IAdvanceAxis)ultraChart1.CompositeChart.ChartLayers[0].ChartLayer.Grid["X"]; double minPos = xx.MapMinimum - 10; //give more space to start/end of axis to avoid Icon trimming double maxPos = xx.MapMaximum + 5;
//spatialTrendsChart.XAxis.RangeMin = (double)xx.MapInverse(minPos); //spatialTrendsChart.XAxis.RangeMax = (double)xx.MapInverse(maxPos); spatialTrendsChart.XAxis.RangeMin = (double)xx.MapInverse(maxPos); spatialTrendsChart.XAxis.RangeMax = (double)xx.MapInverse(minPos); spatialTrendsChart.XAxis.RangeType = AxisRangeType.Custom;
This does work for the chart: everything is horizontally mirrored. However, the axis labels are gone (not displayed).
Cheers,
Jason
I think the simplest approach is to multiply all your data values by -1, then use IRenderLabel to output the Y-axis labels without the accompanying minus sign.
But if you want to do this in a custom layer, you can change the Y-axis Minimum and Maximum, loop through the SceneGraph to find all the Y-axis Text primitives, change their text strings, loop through the SceneGraph to find all the Poyllines, and change all their DataPoint Y-positions using the Y-axis' Map function. A substantial effort, but in a custom layer you have all the control you need to achieve something like this.
Jason: I replied to you on the other thread, so let me know if I missed anything.
I would also like to know how to reverse the X-Axis. I am handling the FillSceneGraph event by adding a custom layer to the chart and handling the event.
My chart looks like this (lin-log graph solution from this thread http://forums.infragistics.com/forums/t/7048.aspx):
However I would like to mirror the image on the Y-Axis (so the X-Axis range would start from 2000 and end at 2)
I tried playing around with what Jason has above and haven't had any success.
Regards,
Jeff