I was wondering whether there is a way to make an individual Candle in a candle series (and for that matter bars also) proportional instead of fixed size.
So when you zoom right in you don't have tiny teeny little candles (ie whatever their fixed size is) but instead they grow to fill the space a little better.
I noticed this behaviour in a commercial package that I believe also uses TChart ... and the question bubbled up .. is this a property that I just cant find or do they do magic with Candle sizes vs zooming ...
Cheers Phil.
Proportional Candles .. possible ???
Proportional Candles .. possible ???
--------------------
Cheers Phil.
Cheers Phil.
Re: Proportional Candles .. possible ???
Hello Snarkle,
I made a simple code using Zoomed and UnZoomed events, that I think you can use it in your application for increase candle size when you do zoom.
Could you please, tell us if previous code works as you want?
I hope will helps.
Thanks,
I made a simple code using Zoomed and UnZoomed events, that I think you can use it in your application for increase candle size when you do zoom.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
double Xmin,Xmax;
int defaultWidth;
Steema.TeeChart.Styles.Candle candle;
private void InitializeChart()
{
candle = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
candle.FillSampleValues(3);
tChart1.Draw();
Xmin = tChart1.Axes.Bottom.Minimum;
Xmax = tChart1.Axes.Bottom.Maximum;
defaultWidth = candle.CandleWidth;
tChart1.Zoomed +=new EventHandler(tChart1_Zoomed);
tChart1.UndoneZoom +=new EventHandler(tChart1_UndoneZoom);
}
void tChart1_Zoomed(object sender, EventArgs e)
{
double diff = (Xmax - Xmin) / (tChart1.Axes.Bottom.Maximum - tChart1.Axes.Bottom.Minimum);
tChart1.Header.Text = diff.ToString();
candle.CandleWidth = (int)(defaultWidth * diff);
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
candle.CandleWidth = defaultWidth;
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Proportional Candles .. possible ???
Thanks Sandra .. that snippet is marvelous ..
--------------------
Cheers Phil.
Cheers Phil.
Side effect of proprtinal candles.
Greetings,
I implemented a variation of the preceeding code snippet ... simply marvelous
However I have an unexpected side effect where the Candles draw outside the Charts bounds and onto the Axis Label values ...
I remember seeing a property somewhere (I think) that stopped it drawing outside the chart bounds .. but I'll never find it again (no offense guys but the bundled documentation needs some work, some structuring and examples !!!.)
I've attached a pic to show the side effect ... is there, as I have imagined, a property I need to set .... or do I use a workaround and somehow not plot the first and last candles that are visible on the Chart ?
regards Phil.
I implemented a variation of the preceeding code snippet ... simply marvelous
However I have an unexpected side effect where the Candles draw outside the Charts bounds and onto the Axis Label values ...
I remember seeing a property somewhere (I think) that stopped it drawing outside the chart bounds .. but I'll never find it again (no offense guys but the bundled documentation needs some work, some structuring and examples !!!.)
I've attached a pic to show the side effect ... is there, as I have imagined, a property I need to set .... or do I use a workaround and somehow not plot the first and last candles that are visible on the Chart ?
regards Phil.
--------------------
Cheers Phil.
Cheers Phil.
Re: Proportional Candles .. possible ???
Hello Phil,
Could you please attach here a simple example code, where appears your problem, because we can find a good solution for you?
Thanks,
Could you please attach here a simple example code, where appears your problem, because we can find a good solution for you?
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Proportional Candles .. possible ???
Hi Phil,
I think you are looking for the demo at All Features\Welcome !\Axes\Opaque zones. Isn't it?
However, we can't reproduce it with the code that Sandra posted above. So it would probably be better if you could send us a simple example so we can investigate it.
I think you are looking for the demo at All Features\Welcome !\Axes\Opaque zones. Isn't it?
However, we can't reproduce it with the code that Sandra posted above. So it would probably be better if you could send us a simple example so we can investigate it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Proportional Candles .. possible ???
Thanks Yeray,
I found this in that example ... tChart1.Aspect.ClipPoints=false;
I made it "true" and now the enlarged candles are suitably clipped ...
I found this in that example ... tChart1.Aspect.ClipPoints=false;
I made it "true" and now the enlarged candles are suitably clipped ...
--------------------
Cheers Phil.
Cheers Phil.
Re: Proportional Candles .. possible ???
Hello Snarkle,
I am glad that works fine for you now .
Thanks,
I am glad that works fine for you now .
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |