Chart draw strange using Axis Breaks Tool
Chart draw strange using Axis Breaks Tool
Dear Support,
I am trying to make a 15 minutes candle chart that cover multiple weeks of data and insert some axis break to hide empty spaces over weekends.
When i do this, the chart seems good at first but if I try to zoom in or pan it,the chart becomes corrupted and starts drawing series incorrectly.
Moving the chart or zooming it, peaces of series start to disappear and reappear during the mouse action, also sometime a series draw until a break and then continue drawing from the break backward.
Here is some picture to show what i mean:
Chart Look good at start: panning a bit on the left a piece of series disappear: zooming the chart and panning a bit, the series disappear in many points and in some point it draw backward: I done many tries but without success. Can you please help me to understand whats happen?
Sincerely,
I am trying to make a 15 minutes candle chart that cover multiple weeks of data and insert some axis break to hide empty spaces over weekends.
When i do this, the chart seems good at first but if I try to zoom in or pan it,the chart becomes corrupted and starts drawing series incorrectly.
Moving the chart or zooming it, peaces of series start to disappear and reappear during the mouse action, also sometime a series draw until a break and then continue drawing from the break backward.
Here is some picture to show what i mean:
Chart Look good at start: panning a bit on the left a piece of series disappear: zooming the chart and panning a bit, the series disappear in many points and in some point it draw backward: I done many tries but without success. Can you please help me to understand whats happen?
Sincerely,
Re: Chart draw strange using Axis Breaks Tool
Hello ECNSquare,
Could you please send me your project, because we can try to reproduce your problem here and try to suggest you a solution?
Thanks,
Could you please send me your project, because we can try to reproduce your problem here and try to suggest you a solution?
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: Chart draw strange using Axis Breaks Tool
Dear Support,
send the entire project is not a simple task.
To reproduce the issue you can do these steps:
- Create a candles chart adding two or three weeks of 15 minutes bars
- Add the axis break tool
- Add breaks to hide empty data on weekends
- try to scroll and/or zoom the chart
If you are not able to reproduce the behavior i can create a project adhoc for you.
Thanks in advance,
send the entire project is not a simple task.
To reproduce the issue you can do these steps:
- Create a candles chart adding two or three weeks of 15 minutes bars
- Add the axis break tool
- Add breaks to hide empty data on weekends
- try to scroll and/or zoom the chart
If you are not able to reproduce the behavior i can create a project adhoc for you.
Thanks in advance,
Re: Chart draw strange using Axis Breaks Tool
Hello ECNSquare,
I can not still reproduce your problem, using next code made following your recommendations:
Could you please modify my code or send us a simple project, because we can reproduce your problem here?
Thanks,
I can not still reproduce your problem, using next code made following your recommendations:
Code: Select all
Steema.TeeChart.TChart tChart1;
Steema.TeeChart.Tools.ScrollPager scrollpager1;
public Form1()
{
InitializeComponent();
tChart1 = new TChart();
this.Controls.Add(tChart1);
tChart1.Top = 150;
tChart1.Left = 100;
tChart1.Height = 400;
tChart1.Width = 550;
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//InitializeChart.
tChart1.Series.Clear();
Steema.TeeChart.Styles.Candle candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
Steema.TeeChart.Styles.Candle candle2 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
Random rnd = new Random();
DateTime today = DateTime.Today;
candle1.XValues.DateTime = true;
candle2.XValues.DateTime = true;
candle1.DateTimeFormat = "dd/MM/yyyy";
candle2.DateTimeFormat = "dd/MM/yyyy";
candle1.FillSampleValues(50);
candle2.FillSampleValues(50);
scrollpager1 = new ScrollPager(tChart1.Chart);
Steema.TeeChart.Styles.FastLine line1 = new FastLine(scrollpager1.Chart);
line1.DataSource = candle1;
line1.RefreshSeries();
line1.XValues.DateTime = true;
line1.DateTimeFormat = "dd/MM/yyyy";
scrollpager1.Series = line1;
//AxesBreaks.
Steema.TeeChart.Tools.AxisBreaksTool axisbreak = new Steema.TeeChart.Tools.AxisBreaksTool(tChart1.Chart);
Steema.TeeChart.Tools.AxisBreak axisBreak1 = new Steema.TeeChart.Tools.AxisBreak(axisbreak);
Steema.TeeChart.Tools.AxisBreak axisBreak2 = new Steema.TeeChart.Tools.AxisBreak(axisbreak);
axisBreak1.StartValue = DateTime.Today.AddDays(25).ToOADate();
axisBreak1.EndValue = DateTime.Today.AddDays(20).ToOADate();
axisBreak2.StartValue = DateTime.Today.AddDays(10).ToOADate();
axisBreak2.EndValue = DateTime.Today.AddDays(15).ToOADate();
axisbreak.Axis = tChart1.Axes.Bottom;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd-MM-yyyy";
axisbreak.GapSize = 10;
tChart1.Axes.Bottom.Labels.Angle = 90;
tChart1.Draw();
tChart1[2].Active = false;
}
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: Chart draw strange using Axis Breaks Tool
Dear Support,
I prepared i small project for you to show you the problem.
As you can see, scrolling the chart from the scroller, part of the chart disappear during scroll/zoom operation when the selection go over an empty date.
I also noticed that the problem is most visible if i modify Axes.Bottom.Minimum/Maximum manually.
Hope this could help.
Best Regards,
I prepared i small project for you to show you the problem.
As you can see, scrolling the chart from the scroller, part of the chart disappear during scroll/zoom operation when the selection go over an empty date.
I also noticed that the problem is most visible if i modify Axes.Bottom.Minimum/Maximum manually.
Hope this could help.
Best Regards,
Re: Chart draw strange using Axis Breaks Tool
Here is the project file.
- Attachments
-
- SteemaTestApp.zip
- VisualStudio Example Project
- (32.03 KiB) Downloaded 429 times
Re: Chart draw strange using Axis Breaks Tool
Hello ECNSquare,
Finally I can reproduce your problem and I have added it in bug list report with number [TF02016734]. We will try to fix it to upcoming versions of TeechartFor.Net.
On the other hand, I recommend you taking a look in the TeeChart Demo project, concretely in Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends, where there is an example that explain as you need do to add series without weekends. I think it can help you to solve your problem.
Finally I can reproduce your problem and I have added it in bug list report with number [TF02016734]. We will try to fix it to upcoming versions of TeechartFor.Net.
On the other hand, I recommend you taking a look in the TeeChart Demo project, concretely in Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends, where there is an example that explain as you need do to add series without weekends. I think it can help you to solve your problem.
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: Chart draw strange using Axis Breaks Tool
Dear Support,
I have already explored the way you suggest but avoiding date usage on X Axis we really opens the door to a number of issues in chart data management.
We use your library to make advanced financials charts and this also include comparisons between series with different time frames and different lengths.
What i mean is that removing dates from x axis will cause series to draw one on top of the other without placing bars in the correct place.
This is only one of the issues that your suggested approach will cause, others are related to chart drawings like trend lines or Fibonacci where we use dates to identify start and end points.
We kindly ask you to suggest a different way to solve the problem that could involve the usage of date values on x axis.
Best Regards,
I have already explored the way you suggest but avoiding date usage on X Axis we really opens the door to a number of issues in chart data management.
We use your library to make advanced financials charts and this also include comparisons between series with different time frames and different lengths.
What i mean is that removing dates from x axis will cause series to draw one on top of the other without placing bars in the correct place.
This is only one of the issues that your suggested approach will cause, others are related to chart drawings like trend lines or Fibonacci where we use dates to identify start and end points.
We kindly ask you to suggest a different way to solve the problem that could involve the usage of date values on x axis.
Best Regards,
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Chart draw strange using Axis Breaks Tool
Hi ECNSquare,
Thanks for your feedback. In that case, my recomendation is setting to null those points which you don't want to be visible or were you want a gap in the chart. Internally, setting a point to null, only means setting its color to Color.Transparent. Data for this point is not discarded and can be displayed at any time just setting it back to the original color. You can add null points to a series as described in Tutorial 5. Tutorials are available at TeeChart's program group. You can also turn a point to transparent adding the Color.Transparent argument when populating it, for example:
Finally, you can also set a point to be null with the SetNull method:
Finally, you may also be interested in the options on how to display null points in TeeChart. You can find several examples at the features demo, available at TeeChart's program group, for example: All Features\Welcome !\Chart styles\Standard\Fast Line\FastLine Null points.
If this doesn't help don't hesitate to let us know.
Thanks for your feedback. In that case, my recomendation is setting to null those points which you don't want to be visible or were you want a gap in the chart. Internally, setting a point to null, only means setting its color to Color.Transparent. Data for this point is not discarded and can be displayed at any time just setting it back to the original color. You can add null points to a series as described in Tutorial 5. Tutorials are available at TeeChart's program group. You can also turn a point to transparent adding the Color.Transparent argument when populating it, for example:
Code: Select all
bar1.Add(10, 1234, "label", Color.Transparent);
Code: Select all
int i = bar1.Add(10, 1234, "label", Color.Transparent);
bar.SetNull(i);
If this doesn't help don't hesitate to let us know.
Best Regards,
Narcís Calvet / 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 |