Hi, Guys:
I asked you the following question yesterday:
> Normally the axis's label value is from smaller to bigger one. How can I set the label value from bigger one to smaller one?
> For example, I have a primiary axis Y, whose value is from 1 to 100 (smaller ==> bigger), I need a secondary axis Y, whose value is from 1 to 0.01 (bigger ==> smaller). How can i set it?
You told me your current version can not do it, I don't know if it's the same for winform, ASP.NET, and WPF, which means none of them can do the reverse axis?
thanks ...
/Cathy
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.
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