S
Sascha Sertel
Hi there,
after browsing through this newsgroup and archives carefully, I believe the
following problem has not been discussed yet (since I really don't like to
see people repeating the same question over and over again). I'm using OWC11
on IIS 5.1.
Actually the question of how to add a secondary axis has been asked many
times and I know how to do it, just for reference look here if you want to
know how: http://support.microsoft.com/default.aspx?kbid=286211
But my problem has a twist to it: What I want (and works fine in Excel) is
to have a single Chart with two Clustered Columns and two Lines in it. The
two columns should use the left-hand value axis, the two Lines should use
the right-hand axis. Very easily done in Excel by chosing the respective
axis on the 'Plot Series on Axis...' option in the series properties.
However, in OWC it is not that simple. Actually it works fine for two
columns and ONE line. When I add the first Line, I use the Ungroup method to
make it use its own scale, then use the Axes.Add method to add a scale on
the right-hand side for that series. Now when I add the series for the
second line, there are only two possible behaviors: If I don't Ungroup it,
then it will use the same scale as the columns, thus screwing up my chart.
If I Ungroup it, then it will use none of the existing scales but its own
scale, which is also not what I want, because I want it to use the same
scale as the first line.
When looking through the properties of the ChSeries object I found the
ChScalings object, which seemed like a possibility to make the second line
use the same scaling as the first line. However, when trying to assign the
scaling values from the first line to the second line, either nothing
happens at all and it still looks the same, or the second line disappears
completely. This is what I did for example:
sc2.Ungroup True
sc2.Scalings(c.chDimValues).HasAutoMinimum = False
sc2.Scalings(c.chDimValues).HasAutoMaximum = False
sc2.Scalings(c.chDimValues).Minimum = sc.Scalings(c.chDimValues).Minimum
sc2.Scalings(c.chDimValues).Maximum = sc.Scalings(c.chDimValues).Maximum
Where sc2 is the second line and sc is the first line. I tried setting the
HasAuto... values to False because I didn't want them to interfere with my
manual settings. Didn't seem to make a difference. If I execute it with the
above code the second line disappears completely. If I use Response.Write to
print the Minimum and Maximum values, they are all 0 (or sometimes very
close to 0, as in 1.9293293E-36).
I also tried similar things by using the Scaling property of the second
ChAxis object, but the results were the same. It seems logical to use the
Scalings objects to try to make one line use the same scale as another line,
but it doesn't seem to work the way I try it.
I have a complete source code I could post here with arrays which contain
sample data, so no database or anything is needed, but I'll wait for a
response first, maybe someone knows how to solve this without having the
full code. If needed, I will post it in a reply then.
Thanks a lot,
Sascha
after browsing through this newsgroup and archives carefully, I believe the
following problem has not been discussed yet (since I really don't like to
see people repeating the same question over and over again). I'm using OWC11
on IIS 5.1.
Actually the question of how to add a secondary axis has been asked many
times and I know how to do it, just for reference look here if you want to
know how: http://support.microsoft.com/default.aspx?kbid=286211
But my problem has a twist to it: What I want (and works fine in Excel) is
to have a single Chart with two Clustered Columns and two Lines in it. The
two columns should use the left-hand value axis, the two Lines should use
the right-hand axis. Very easily done in Excel by chosing the respective
axis on the 'Plot Series on Axis...' option in the series properties.
However, in OWC it is not that simple. Actually it works fine for two
columns and ONE line. When I add the first Line, I use the Ungroup method to
make it use its own scale, then use the Axes.Add method to add a scale on
the right-hand side for that series. Now when I add the series for the
second line, there are only two possible behaviors: If I don't Ungroup it,
then it will use the same scale as the columns, thus screwing up my chart.
If I Ungroup it, then it will use none of the existing scales but its own
scale, which is also not what I want, because I want it to use the same
scale as the first line.
When looking through the properties of the ChSeries object I found the
ChScalings object, which seemed like a possibility to make the second line
use the same scaling as the first line. However, when trying to assign the
scaling values from the first line to the second line, either nothing
happens at all and it still looks the same, or the second line disappears
completely. This is what I did for example:
sc2.Ungroup True
sc2.Scalings(c.chDimValues).HasAutoMinimum = False
sc2.Scalings(c.chDimValues).HasAutoMaximum = False
sc2.Scalings(c.chDimValues).Minimum = sc.Scalings(c.chDimValues).Minimum
sc2.Scalings(c.chDimValues).Maximum = sc.Scalings(c.chDimValues).Maximum
Where sc2 is the second line and sc is the first line. I tried setting the
HasAuto... values to False because I didn't want them to interfere with my
manual settings. Didn't seem to make a difference. If I execute it with the
above code the second line disappears completely. If I use Response.Write to
print the Minimum and Maximum values, they are all 0 (or sometimes very
close to 0, as in 1.9293293E-36).
I also tried similar things by using the Scaling property of the second
ChAxis object, but the results were the same. It seems logical to use the
Scalings objects to try to make one line use the same scale as another line,
but it doesn't seem to work the way I try it.
I have a complete source code I could post here with arrays which contain
sample data, so no database or anything is needed, but I'll wait for a
response first, maybe someone knows how to solve this without having the
full code. If needed, I will post it in a reply then.
Thanks a lot,
Sascha