Author |
Topic  |
|
emcc
15 Posts |
Posted - 07 Jan 2009 : 06:49:12
|
I have a complicated chart with several axes and physicalCoordinates, and Grids. The order in which I add the object effects how the grid lines appear, and also axis intercepts I have setup. One of the axes is an inverted log axis. I am trying to keep the related x-axis at the bottom of the plot area, but sometimes it ends up at the top of the inverted y-axis. Does adding a Grid effect the axes in any way? Thanks in advance for any suggestions. |
|
quinncurtis
1164 Posts |
Posted - 07 Jan 2009 : 09:01:47
|
It is possible, if you improperly setup the grids.
It is assumed that you create all of the axes first, then the grids, since to do it in a different order would not make sense.
In the grid constructors you must pass in two axes. It is imperative that these two axes use the same coordinate system. If you have coordinate system #1 with axes X1 and Y1, and coordinate system #2 with axes X2 and Y2, it could cause problems if you then tried to define a grid using X1 and Y2, or X2 and Y1. You should check that very carefully.
In the example above, it would be common to define two coordinate systems that have the same x-scale (probably linear or time), but different y-scale. Since they have the same x-scale, you might only draw one x-axis. You then try and create grids for both y-axes, reference the same x-axis. But that would be an error, since the x-axis belongs to only one coordinate system.
If you are still unable to fix it, we would need the complete source to an example that reproduces the problem in order to provide additional advise.
|
 |
|
emcc
15 Posts |
Posted - 07 Jan 2009 : 15:31:38
|
That's probably what it is. My y-axis is actually divided into 3 axes, but I have only 1 x-axis in a different coordinate system. So i need to create 3 'dummy' x-axes for drawing the grids, and disable them somehow so they don't draw. I'll let you know how I get on. |
 |
|
quinncurtis
1164 Posts |
Posted - 07 Jan 2009 : 17:05:25
|
Create the "extra" x-axes, the same as the original. They should overlay the original exactly, so you should not see them. No need to create additional axis labels.
You can disable the actual drawing of the extra axes by setting the axis ChartObjEnable to ChartObj.OBJECT_ENABLE_NODRAW, as in the example below. It is important that you use OBJECT_ENABLE_NODRAW, and add the extra axes to the ChartView, otherwise they will not be sized properly, which is important if you reference it in a Grid constructor.
TimeAxis xAxis2 = new TimeAxis(pTransform1); xAxis2.SetColor(Color.Black); xAxis2.ChartObjEnable = ChartObj.OBJECT_ENABLE_NODRAW; chartVu.AddChartObject(xAxis2); |
 |
|
emcc
15 Posts |
Posted - 07 Jan 2009 : 18:44:33
|
OK, Thanks. Things are working more consistently now. (Pity I didn't ask you a couple of days ago). |
 |
|
|
Topic  |
|
|
|