Page 1 of 1

Chart draw strange using Axis Breaks Tool

Posted: Wed Oct 02, 2013 5:54 pm
by 15666966
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:
axis_break_bug_01.PNG
axis_break_bug_01.PNG (28.75 KiB) Viewed 10812 times
panning a bit on the left a piece of series disappear:
axis_break_bug_02.PNG
axis_break_bug_02.PNG (25.74 KiB) Viewed 10808 times
zooming the chart and panning a bit, the series disappear in many points and in some point it draw backward:
axis_break_bug_03.PNG
axis_break_bug_03.PNG (30.72 KiB) Viewed 10792 times
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

Posted: Thu Oct 03, 2013 2:08 pm
by 10050769
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,

Re: Chart draw strange using Axis Breaks Tool

Posted: Fri Oct 04, 2013 2:24 pm
by 15666966
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,

Re: Chart draw strange using Axis Breaks Tool

Posted: Tue Oct 08, 2013 10:18 am
by 10050769
Hello ECNSquare,

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; 
   }
Could you please modify my code or send us a simple project, because we can reproduce your problem here?

Thanks,

Re: Chart draw strange using Axis Breaks Tool

Posted: Tue Oct 08, 2013 3:18 pm
by 15666966
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,

Re: Chart draw strange using Axis Breaks Tool

Posted: Tue Oct 08, 2013 3:22 pm
by 15666966
Here is the project file.

Re: Chart draw strange using Axis Breaks Tool

Posted: Wed Oct 09, 2013 3:42 pm
by 10050769
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.

Re: Chart draw strange using Axis Breaks Tool

Posted: Wed Oct 09, 2013 6:30 pm
by 15666966
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,

Re: Chart draw strange using Axis Breaks Tool

Posted: Thu Oct 10, 2013 7:19 am
by narcis
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:

Code: Select all

bar1.Add(10, 1234, "label", Color.Transparent);
Finally, you can also set a point to be null with the SetNull method:

Code: Select all

int i = bar1.Add(10, 1234, "label", Color.Transparent);
bar.SetNull(i);
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.