Jump to content
Software FX Community

Drawing errors in graphs, real time mode switching and more...


User (Legacy)

Recommended Posts

1. Enclosed is a screenshot (ChartError-1.png) of a graph drawing error. 

The data grid is highlighted where the data is drawn incorrectly. Any idea

what is going on here?

2. My application changes the chart from realtime mode to "normal" mode in

order to provide higher speed redraws while monitoring hardware live. I

have found through trial and error that in order to draw the graph properly

again when not using realtime API, you must set

chart.RealTime.BufferSize = 0

This is not obvious.

3. Additional SeriesAttributes should be able to be added using the generic

Series.Add method. I did get it work using the Data.Series property.

4. Using the chart.Data.Clear() method removes all the SeriesAttributes in

the chart. Not obvious and not necessarily desirable.

5. Using the chart.Panes.Clear() method always leaves one Pane, again not

obvious or necessarily desirable.

6. I have had trouble using the chart in a TabControl. The application will

crash as soon as the form is loaded. Sometimes it will simply exit without

any exception information. I have had to install a work around where adding

a chart to the main form (in addition to the one in the tab control) allows

the charting control to somehow initialize itself so the second instance in

the tab control will work properly. Any ideas on this one?

7. Enclosed is a screenshot (ChartError-2.png) of a graph drawing error.

Note that the last X axis label is being cutoff. Can this be fixed somehow?

This application orignally ran under ChartFX 6.2 and most of these problems

are new to this revision.

Link to comment
Share on other sites

> 1. Enclosed is a screenshot (ChartError-1.png) of a graph drawing error. 

> The data grid is highlighted where the data is drawn incorrectly. Any

> idea what is going on here?

This seems to be a bug. Please provide with sample code or detailed

instructions on how to reproduce this problem. You may save your chart in a

binary file (using the Export method) reload it in a default chart and see

if the problem happens there too, if so, you can post the binary file.

> 2. My application changes the chart from real-time mode to "normal" mode

> in ...

What does "normal" mode means to you ? if it means not having a circular

buffer then setting BufferSize to 0 is the correct way to do it, it is just

the opposite of doing BufferSize = <something> which you did to go into

"real-time mode".

> 3. Additional SeriesAttributes should be able to be added using the

> generic Series.Add method. I did get it work using the Data.Series

> property.

This is not the way it works, the number of series in the data dictates the

number of series in the chart, not the other way around. One of them have to

have precedence over the other in order to resolve inconsistencies and to

avoid having to do both to add a series. We decided for the Data to be the

dominant factor as it is easier to manipulate, for example I can say I wan

two (2) series just by doing:

chart.Data.Series = 2;

To do it using the series collections I will have to remove or add series

accordingly making the code more complicated.

> 4. Using the chart.Data.Clear() method removes all the SeriesAttributes in

> the chart. Not obvious and not necessarily desirable.

By design. Data.Clear sets the number of series to zero (0) so the series

collection has to be clear in order to maintain consistency. Notice that the

Series collection is not cleared right away, it is only cleared when

consistency is needed, for example when painting or when you ask for

chart.Series, if you set the number of series to something immediately after

ClearData, the series collection will be maintain and will be padded or

trimmed according to the number of series. For example:

chart1.Series[0].Color = Color.Red;

chart1.Data.Clear();

chart1.Data.Series = 1;

Will leave one series in the Series collection and will keep the attributes

for that series.

> 5. Using the chart.Panes.Clear() method always leaves one Pane, again not

> obvious or necessarily desirable.

The chart ALWAYS has one pane otherwise it couldn´t show anything. This is

by design.

> 6. I have had trouble using the chart in a TabControl. The application

> will crash as soon as the form is loaded. Sometimes it will simply exit

> without any exception information. ...

This seems like a bug, however I´m unable to reproduce it. I tried putting a

chart in a tab control and doing different things with it but I was unable

to make it crash. Please provide with sample code or detailed instructions

on how to reproduce this crash.

> 7. Enclosed is a screenshot (ChartError-2.png) of a graph drawing error.

> Note that the last X axis label is being cutoff. Can this be fixed

> somehow?

You may increase the right margin as follows:

chart1.PlotAreaMargin.Right = 40;

--

Francisco Padron

www.chartfx.com

Attachments.zip

Link to comment
Share on other sites

Thanks for the quick response, I will try to post more info on the errors.

Some of these comments are more based on the need to document certain items

in the API. I appreciate that the API has been implemented in certain ways,

but I have had to learn certain things by time consuming trial and error.

Collections typically behave in a certain ways that developers have grown

accustomed to, and the API uses them but restricts their use in certain

undocumented ways. This causes confusion. Documenting this behavior would

help. It would seem straight forward to implement the "expected"

functionality with a Series.Add method, for example.

The fact that the series will retain its parameters if it is cleared and

then reused does clear up some problems. One again the "expected" (by me

anyway) behavior would be that the series attributes would be set to

defaults when a series is "cleared" and a new series is created.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:P4lwwp$$FHA.3220@webserver3.softwarefx.com...

>> 1. Enclosed is a screenshot (ChartError-1.png) of a graph drawing error.

>> The data grid is highlighted where the data is drawn incorrectly. Any

>> idea what is going on here?

>

> This seems to be a bug. Please provide with sample code or detailed

> instructions on how to reproduce this problem. You may save your chart in

> a binary file (using the Export method) reload it in a default chart and

> see if the problem happens there too, if so, you can post the binary file.

>

>> 2. My application changes the chart from real-time mode to "normal" mode

>> in ...

>

> What does "normal" mode means to you ? if it means not having a circular

> buffer then setting BufferSize to 0 is the correct way to do it, it is

> just the opposite of doing BufferSize = <something> which you did to go

> into "real-time mode".

>

>> 3. Additional SeriesAttributes should be able to be added using the

>> generic Series.Add method. I did get it work using the Data.Series

>> property.

>

> This is not the way it works, the number of series in the data dictates

> the number of series in the chart, not the other way around. One of them

> have to have precedence over the other in order to resolve inconsistencies

> and to avoid having to do both to add a series. We decided for the Data to

> be the dominant factor as it is easier to manipulate, for example I can

> say I wan two (2) series just by doing:

>

> chart.Data.Series = 2;

>

> To do it using the series collections I will have to remove or add series

> accordingly making the code more complicated.

>

>> 4. Using the chart.Data.Clear() method removes all the SeriesAttributes

>> in the chart. Not obvious and not necessarily desirable.

>

> By design. Data.Clear sets the number of series to zero (0) so the series

> collection has to be clear in order to maintain consistency. Notice that

> the Series collection is not cleared right away, it is only cleared when

> consistency is needed, for example when painting or when you ask for

> chart.Series, if you set the number of series to something immediately

> after ClearData, the series collection will be maintain and will be padded

> or trimmed according to the number of series. For example:

>

> chart1.Series[0].Color = Color.Red;

>

> chart1.Data.Clear();

>

> chart1.Data.Series = 1;

>

> Will leave one series in the Series collection and will keep the

> attributes for that series.

>

>> 5. Using the chart.Panes.Clear() method always leaves one Pane, again not

>> obvious or necessarily desirable.

>

> The chart ALWAYS has one pane otherwise it couldn´t show anything. This is

> by design.

>

>> 6. I have had trouble using the chart in a TabControl. The application

>> will crash as soon as the form is loaded. Sometimes it will simply exit

>> without any exception information. ...

>

> This seems like a bug, however I´m unable to reproduce it. I tried putting

> a chart in a tab control and doing different things with it but I was

> unable to make it crash. Please provide with sample code or detailed

> instructions on how to reproduce this crash.

>

>> 7. Enclosed is a screenshot (ChartError-2.png) of a graph drawing error.

>> Note that the last X axis label is being cutoff. Can this be fixed

>> somehow?

>

> You may increase the right margin as follows:

>

> chart1.PlotAreaMargin.Right = 40;

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...