Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Single point not shown on line chart when chart bounnded to DataSource (Read 5496 times)
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Single point not shown on line chart when chart bounnded to DataSource
Jan 29th, 2014 at 12:20pm
Print Post  
Hi,

I have encountered a problem working with line chart which is bounded to a DataSet's DataTable.
When there is more than one row in the DataTable, the graph shows all the points correctly.
However, when the DataTable contains a single row, I expect to see a single point in the chart corresponding to the row's field relevant value. However, no points are displayed on the chart at all (I see an empty chart).
I was able to reproduce this behavior on the demo:

On ProfitForm.cs file's ProfitForm_Load() event, I added the following code fragment right after filling the Sales DataTable. I delete all rows except one (the banana row), and the chart does not show its related point on the chart.

Code
Select All
DataTable SalesDataTable = salesDataSet.Tables["Sales"];
                for (int i = SalesDataTable.Rows.Count - 1; i >= 1; i--)
                {
                    SalesDataTable.Rows[i].Delete();
                }
                SalesDataTable.AcceptChanges(); 




I would appreciate your help.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Single point not shown on line chart when chart bounnded to DataSource
Reply #1 - Jan 30th, 2014 at 8:37am
Print Post  
Hi,

The line chart draws only line segments unless you also enable scatter shapes, so it needs at least two points for the first line. If you enable scatters by setting the Scatter bit in LineType property, you should see the scatter shape also for a single point.

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


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Single point not shown on line chart when chart bounnded to DataSource
Reply #2 - Feb 3rd, 2014 at 12:39pm
Print Post  
Hi Stoyan,

Thank you for your answer.
The LineType property is set to Line | Scatter,
but still I can't see single point. Could there be other property which somehow denies the Scatter option ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Single point not shown on line chart when chart bounnded to DataSource
Reply #3 - Feb 3rd, 2014 at 12:59pm
Print Post  
Hi Nir,

I’ve tested this with a sample line chart with a single XData and YData value and LineType set to Line | Scatter, and it did show the scatter shape.

I suppose the single point might be hiding in your app if Min/Max/Interval values are set on X or Y axis, and the data value is outside the specified range (e.g. the axis is from 0 to 50 and the value is 70). Could you check if the data point lies between MinValue and MaxValue for both axes?

Stoyan
  
Back to top
 
IP Logged
 
znavot
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 18
Joined: Dec 31st, 2013
Re: Single point not shown on line chart when chart bounnded to DataSource
Reply #4 - Feb 3rd, 2014 at 1:31pm
Print Post  
Hi Stoyan,

Apparently, the point was in the correct range, but the minimum value of the X axis was identical to the maximum value (which was identical to the point X-data value).
Setting a small buffer between the minimum and the maximum values did the trick.

Thank you very much !
Nir
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint