Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Labels, zooming and tooltip (Read 14430 times)
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Labels, zooming and tooltip
Apr 1st, 2014 at 1:57pm
Print Post  
Hi,

I have a list of questions regarding the use of the line chart. I apologize ahead for its length, and appreciate your help.

1. I tried to show labels on the line chart points, and now I occasionally receive the following exception:

Unhandled exception occured in UI thread System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at MindFusion.Charting.LineChartMeasurer.addLabels()
at MindFusion.Charting.LineChartMeasurer.PrepareVertLines()
at MindFusion.Charting.LineChart.Draw()
at MindFusion.Charting.AxesChart.DrawChart()
at MindFusion.Charting.Chart.CalculateSize()
at MindFusion.Charting.WinForms.Chart.CalcRect()
at MindFusion.Charting.WinForms.Chart.UpdateChartInternal()
at MindFusion.Charting.WinForms.LineChart.set_LabelType(LabelType value)
at MDMindFusionChart.SetChartProps() in D:\...\MDMindFusionChart.cs:line 151

The line in the code the exception gets thrown at is when setting the LabelType (i.e. this.lineChart.LabelType = MindFusion.Charting.LabelType.CustomText;).
Are you familiar with this issue ?

2. Also, when showing the labels, some of them are not shown (see attached screen shots). For instance, the rightmost label, or point labels when zooming in.

3. When I zoom in multiple times, I get an "overflow error" exception.
This occurs only when I register to ZoomChanged event, Even when the event handler is empty. Are you familiar with this behavior ?

4. Is it possible to control the tool tip tolerance ? Currently a delicate adjustment when moving the mouse is required to show the tool tips (especially at the edges of the graph) and I wish to be able to increase the tolerance so the tool tips will be shown more easily.

5. Is it possible to customize the "zoom in" icon ? (personally I think it's cool, but it came from one of our customers, who wishes to replace the icon...)

Thanks, and sorry again for the long list...
Nir
« Last Edit: Apr 1st, 2014 at 2:57pm by znavot »  

NoLabel1.png (Attachment deleted)
NoLabel2.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #1 - Apr 2nd, 2014 at 9:35am
Print Post  
Hi,

By "overflow error" do you mean a stack overflow? Could you attach a test project that reproduces 1 and 3?

Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #2 - Apr 2nd, 2014 at 11:28am
Print Post  
Hi Stoyan,

Attached is a solution which reproduces the overflow issue.
Steps to reproduce:
1. Unzip the solution.

2. Add references (I had to remove them because maximum allowed file size limitation)
MindFusion.Charting.dll version 3.5.1.40346
MindFusion.Charting.WinForms.dll version 3.5.1.40347
MindFusion.Common.dll version version 1.3.0.19101

3. Compile & Run solution.

3. Click the command button to display the chart on a user control.

4. Zoom in several times quickly and receive the overflow exception.

The other issue is a bit more trickier to reproduce. It may involve additional parameters. I will upload it once I complete it.

Thanks,
Nir
  

MindFusionTests.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #3 - Apr 3rd, 2014 at 7:29am
Print Post  
When zoomed-in a lot, the control calls DrawLine with very large coordinates and relies on GDI+ to clip it, but it seems there's some bug in the clipping code that throws the overflow exception. We'll try to work around it by clipping the line ourselves. That does not seem related to the ZoomChanged event, we were able to reproduce without it.

Our developer has implemented points 2,4 and 5. For 1 please check if you provide as many custom labels as the values in the data arrays. If that's the problem indeed and there are less labels than data points, you will probably get the index exception. We are not sure if we should add checks to ignore differences in the number of labels provided - that might hide errors in your code and show labels at wrong positions. In such situations perhaps we should only throw our own exception providing a better description of the error.

Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #4 - Apr 3rd, 2014 at 8:58am
Print Post  
Hi Stoyan,

Thank you very much for your help.

I was able to reproduce the issue with the index exception.
Apparently the exception is thrown when I have a single record in the data table. In order to reproduce it on your side, please take the solution I have sent you and comment the following lines in Form1.button1_click() method:

//dataTable.Rows.Add("01/01/2012", 41.456);
//dataTable.Rows.Add("01/01/2014", 30);

This leaves the DataTable with a single row.

Run the solution and you shell receive the exception.

Thanks,
Nir

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #5 - Apr 10th, 2014 at 8:45am
Print Post  
Hi Nir,

Please check the personal messages page for updated assemblies.

2. The hidden labels should be fixed now.

3. We have implemented our own clipping method for line and scatter charts, it seems to fix the overflow error. We'll implement it for other chart types (e.g. area) in next few days.

4. The tool tip tolerance can be controlled with the HitTestOffset property, which also indicates the radius of the area around a point that will be considered as a click on the point for hit-test events.

5. You can use the new Chart.ZoomCursor property to specify a custom zoom cursor.

1. We could not reproduce the exception on a single data row table in your example. It is possible that the changes we've made to correct the overflow exception have fixed the index exception as well, please let us know if it still happens.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #6 - Apr 13th, 2014 at 11:41am
Print Post  
Hi Stoyan,

Thank you very much for your help.

Most of the issues seems to be resolved (I still need to get feedback from my customers regarding some).

I no longer get the index exception. However, I get a null exception on the test solution I sent you (referencing the new DLLs now).
Specifically on my project I don't get any exception but I see just the label without the point.

Thanks,
Nir
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #7 - Apr 15th, 2014 at 9:35am
Print Post  
Hi,

You can find a new build on the PM page that should fix the missing point when there's a single data row.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #8 - Apr 16th, 2014 at 5:25am
Print Post  
Thanks Stoyan

It works  Smiley

Nir
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #9 - Apr 16th, 2014 at 2:03pm
Print Post  
Hi Stoyan,

After further testings it seems I was happy too soon...
I'm still unable to see a single point when its value is a decimal number with a fractional part (e.g. 1.1 to 1.9, 2.1 to 2.9 etc.).

I also have another issue with the labels. Sometimes they get cut off (mostly when zooming in, otherwise I use a buffer to avoid this). This appears to be a severe problem for my customers, since we use the chart to show medical values. If for instance, a certain medical value is "180" and a physician sees a cut off "80" label, it might jeopardize his patients and we can't take this risk.

I would appreciate your help, and again I'm very thankful for all you did so far.

Nir
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #10 - Apr 17th, 2014 at 9:32am
Print Post  
Hi Nir,

For the floating point numbers problem try setting XAxisSettings.DataFormat = Number. The default Auto format might be deciding you are providing date/time values and drawing them away from the currently visible interval.

On the PM page you can find updated version of the control that won't clip labels.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #11 - Apr 17th, 2014 at 11:47am
Print Post  
Hi Stoyan,

Thank you very much for the DLL.
From first look it seems the labels are no longer being cut off.

I have set the YAxisSettings.DataFormat to Number and now it seems to show every value I tried, integer and floating point, except for 0.

Thanks,
Nir
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #12 - Apr 18th, 2014 at 8:10am
Print Post  
Hi,

We can't see any problem showing a single value at 0 in your test project. What should we change to make it disappear?

Stoyan
  

Untitled-1.png (Attachment deleted)
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Labels, zooming and tooltip
Reply #13 - Apr 22nd, 2014 at 4:28am
Print Post  
Hi Stoyan,
To reproduce this issue, you should comment out all rows addition to the DataTable in Form1.cs, and instead add a single DataRow with 0 value in the YField column.
For example:
dataTable.Rows.Add("08/30/2010 11:50:00", 0);

Regards,
Nir
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Labels, zooming and tooltip
Reply #14 - Apr 22nd, 2014 at 10:56am
Print Post  
The label at Y=0 seems to get out of the visible range because of these lines in the test project:

this.lineChart.YAxisSettings.MinValue = 10;
this.lineChart.YAxisSettings.MaxValue = 80;

Anyway we've fixed an alignment bug happening with that label, you can find updated assembly on the PM page.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint