Jump to content
Software FX Community

changing LineWidth for single series (2D line) in 50-series chart hangs chartfx


User (Legacy)

Recommended Posts

I have a problem with a multi-series chart (2D line, about 50 series with 

2500 data points each), which hangs completely after I have tried to change

the LineWidth of a single series.

This happens both ways: programmatically ( chart.Series[i].LineWidth = 3; )

and manually (context menu > properties > series tab > weight > apply)

Could it be, that the chart cannot handle easily the LineWidth change, if

there are too many series?

I use ChartFX 6.2 (WinForms) in C# , VS 2003 under Windows XP SP2

Holger

zoomed_printout_bug.zip

Link to comment
Share on other sites

> Could it be, that the chart cannot handle easily the LineWidth change, if 

> there are too many series?

No. That shouldn't be a problem.

I was unable to reproduce this problem using the latest version, I tried

with a 50 series line chart with 2500 points each. This chart does take a

little time to draw if all points are shown at once (no scrollbar), about 4

secs with antialias and 3 secs. without in my pc but it draws fine, this is

normal for a chart this big (50 x 2500 = 125,00 points)

Please export the chart right before setting the LineWidth into a binary

file and attach it to your posting so that I can try here.

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

the exported binary is attached.

All my linewidths are set to 1, when I start the chart. With this

configuration the chart takes 3 seconds to draw. Later I change the

linewidth of a single series to 3, and I have stopped the redrawing after

waiting for more than one minute.

I have discovered, the linewidth changes fast when the chart is zoomed and

only one series is visible in the zoomed area. The linewidth in the legend

also changes immediately. When I zoom out again, the chart hangs - like

applying the linewidth in non-zoomed state.

Holger

"SoftwareFX Support" <noreply@softwarefx.com> schrieb im Newsbeitrag

news:6vjd94NqFHA.1724@webserver3.softwarefx.com...

>> Could it be, that the chart cannot handle easily the LineWidth change, if

>> there are too many series?

>

> No. That shouldn't be a problem.

>

> I was unable to reproduce this problem using the latest version, I tried

> with a 50 series line chart with 2500 points each. This chart does take a

> little time to draw if all points are shown at once (no scrollbar), about

> 4

> secs with antialias and 3 secs. without in my pc but it draws fine, this

> is

> normal for a chart this big (50 x 2500 = 125,00 points)

>

> Please export the chart right before setting the LineWidth into a binary

> file and attach it to your posting so that I can try here.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

Link to comment
Share on other sites

Ok. The problem is you are adding a String label with the line:

chart1.YLeg.Add(val.ToString());

Nowhere you are specifying where this label should go.

The way String labels work in a numeric axis is through the LabelValue

property, this property makes the equivalence between the index of the label

(0 in this case) and the logical value in the axis, these labels are evenly

spaced.

If you want to label an arbitrary value, completely independent of Min/Max

and other Axis labels, the best option for you is a Constant Line.

The following code adds a constant line displaying a label for the value

2.37:

ConstantLine cl = new ConstantLine();

cl.Value = val;

cl.Text = val.ToString();

cl.Flags |= ConstantFlag.HideLine | ConstantFlag.OutsideText;

chart1.ConstantLines.Add(cl);

Use this code INSTEAD of the YLeg code. Note that there is no guarantee

that this label won't overlap another axis labels. If this is the ONLY label

you want in your axis, you may hide the regular axis labels by doing:

chart1.AxisY.Style |= AxisStyle.HideText;

--

Francisco Padron

www.chartfx.com

linewidth_bug.zip

Link to comment
Share on other sites

There seems to be a problem with a .NET API with this amount of points 

(Graphics.Curve) when the line width is not 1, an Out Of Memory Exception is

thrown.

I will research this some more, as a workaround I suggest you switch to a

Line chart (instead of Curve), for this amount of points there is not going

to be much difference in the drawing, however the speed will improve a lot.

--

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...