Page 1 of 1
Can I restrict the height of ColorBand?
Posted: Thu Jul 30, 2009 2:50 pm
by 15653258
What I want is the ability to display ColorBands, but only for a certain percentage of the axis they are attached to. That way, they will remain stationary on the chart even if the axis range changes. I have investigated drawing rectangles with Graphic3D and would rather not have to go that way. Does anyone have any suggestions? Is there another tool that might be able to do this? Is this type of functionality other are interested in and therefore might be worth adding to the product?
Re: Can I restrict the height of ColorBand?
Posted: Thu Jul 30, 2009 3:07 pm
by narcis
Hi AndrewP,
What I want is the ability to display ColorBands, but only for a certain percentage of the axis they are attached to.
I think I understand this point. It's not possible using ColorBand. You may want to use Shape series with Style set to rectangle or also RectangleTool.
That way, they will remain stationary on the chart even if the axis range changes.
I don't understand this. Could you please elaborate on that so that we can suggest most suitable solution? Feel free to attach an image if you think it would make the explanation easier or clearer.
Thanks in advance.
Re: Can I restrict the height of ColorBand?
Posted: Thu Jul 30, 2009 3:40 pm
by 15653258
What I want to see is colored bands that only display in the bottom 10% of a given axis. Now if the axis changes (the range increases or decreases) the Colorbands should remain at 10%.
Can I restrict the ColorBand tool to display only within 1 X Axis AND 1 Y Axis?
Re: Can I restrict the height of ColorBand?
Posted: Thu Jul 30, 2009 3:47 pm
by 15653258
I just uploaded an image. What you see if 2 series each on a different Y axis and on the same X axis. The ColorBands (Grenn and Black) are attached to the X axis and appears accross both Y axis. What I want to do is:
- Primary - restrict the ColorBands to one Y axis...
- Secondary - restrict the ColorBands to a part of one Y axis (say the bottom 10% of the Y axis).
What is the best way for me to accomplish this?
Re: Can I restrict the height of ColorBand?
Posted: Fri Jul 31, 2009 9:38 am
by 10050769
Hello AndrewP,
What I want to see is colored bands that only display in the bottom 10% of a given axis. Now if the axis changes (the range increases or decreases) the Colorbands should remain at 10%.
Can I restrict the ColorBand tool to display only within 1 X Axis AND 1 Y Axis?
You couldn't restrict the ColorBand if you have only one Chart, because colorBand is associated with Bottom Axes and only there are one Bottom Axes.
I just uploaded an image. What you see if 2 series each on a different Y axis and on the same X axis. The ColorBands (Grenn and Black) are attached to the X axis and appears accross both Y axis. What I want to do is:
- Primary - restrict the ColorBands to one Y axis...
- Secondary - restrict the ColorBands to a part of one Y axis (say the bottom 10% of the Y axis).
What is the best way for me to accomplish this?
I made a simple code, using a shape series as ColorBand. You could do a similar code as next, please check that next code works correctly in your application.
Code: Select all
Steema.TeeChart.Styles.Shape shape;
Steema.TeeChart.Styles.Line line1, line2;
double x0, x1, y0, y1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
shape = new Steema.TeeChart.Styles.Shape(tChart1.Chart);
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Color = Color.Yellow;
line2.Color = Color.Blue;
line1.Pointer.Visible = true;
line1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Triangle;
line1.Pointer.InflateMargins = false;
line1.FillSampleValues();
line2.FillSampleValues();
//You need paint series after calculate values of shape.
tChart1.Draw();
//Shape series
shape.Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
shape.Pen.Visible = false;
shape.ShowInLegend = false;
x0 = tChart1.Axes.Bottom.Minimum;
x1 = tChart1.Axes.Bottom.Maximum / 12;
y0 = tChart1.Axes.Left.Minimum;
y1 = tChart1.Axes.Left.Maximum / 6;
shape.X0 = x0;
shape.Y0 = y0;
shape.X1 = x1;
shape.Y1 = y1;
}
I hope will helps.
Thanks,