We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Empty chart

Thread ID:

Created:

Updated:

Platform:

Replies:

53612 Dec 17,2006 08:47 AM Sep 2,2011 09:02 AM Windows Forms 12
loading
Tags: Chart
Ana
Asked On December 17, 2006 08:47 AM

Hi,

I have just migrated from the chartcontrol version 4.3 into the latest version 4.4.0.51.
A problem has appeared: I have an application where I sometimes shows a totally empty chart. In the former version this was possible to get by just not adding any series. But in version 4.4.0.51 there are always some default or internal series that are shown (with default color and all that).
How can I get rid of this series? I want to have the same behaviour as before.

Best regards,
Ana

Poly J [Syncfusion]
Replied On December 18, 2006 02:10 AM

Hi Ana,

Thanks for your interest in Syncfusion products.

Yes you are right, when initializing the chart control it is assigning some random data for displaying a series during the runtime if user is not creating any series.

Default constructor for the chart control assigning Random data to the Chart Series.But user can suppress this behavior by overloading the chartconrol initialization. Empty Chart can display by overloading the initialization of chartcontrol.
this.chartControl1 = new Syncfusion.Windows.Forms.Chart.ChartControl(false);

Please refer the attached sample and let me know if this helps you.
EmptyChart


Best Regards,
Poly


Ana
Replied On December 18, 2006 04:00 AM

Hello,
Thanks for the answer. It worked fine until I used initialized the chart. When using any of the following properties the "default created random series" was created again (seems like the chart was reinitialized somewhere in here):

chartcontrol1.PrimaryXAxis.DrawGrid
chartcontrol1.PrimaryXAxis.TickLabelsDrawingMode
chartcontrol1.PrimaryXAxis.RangeType

So, how do I go from here? I really need to set these properties during initialization.
Is there somewhere from outside I can delete the defaul created series?

Best regards,
Ana

Ana
Replied On December 18, 2006 04:09 AM

Hi again,

Even if I didn´t use the properties I listed above the default created series reappeared with the function chartControl.EndUpdate() as well...
//Ana

Poly J [Syncfusion]
Replied On December 18, 2006 08:02 AM

Hi Ana,

Thanks for bringing this issue to our attention.

I am able to reproduce this issue.When calling the method EndUpdate(), it will check for the ChartSeries count and if the count is zero it is adding a series with RandomData to the chart control.

Please find the attached Sample
for workaround for this issue. User can create an empty series so that chartcontrol will not assign a Random Data Series.

If this not satisfies your requirement please create a direct-trac incident for the same. We will send you the refreshed dlls for this issue.

Best Regards,
Poly





Ana
Replied On December 18, 2006 10:03 AM

Hi again,

The workaround works fine for me! Thanks a lot for the help.

Best regards,
Ana

Poly J [Syncfusion]
Replied On December 18, 2006 10:20 PM

Hi Ana,

We are glad to hear that the issue is resolved.

Best Regards,

Poly



Chloe Vuillet
Replied On August 23, 2011 12:35 AM

Hi,

I am having the same issue trying to have empty chartcontrols when opening my form & trying to get a function to empty/reinitialize my chartcontrol. The sample likes given above have been desactivated, were can I access them?

Thx & Regards


Sivakumar D [Syncfusion]
Replied On August 23, 2011 01:47 AM

Hi Clo,

Thanks for your interest in Syncfusion products.

We suggest you to set AddRandomSeries of chartcontrol to false and clear all the default series in the chart.please refer below code snippet.

[C#]

this.chartControl1.AddRandomSeries = false;
this.chartControl1.Series.Clear();

For your convenience, we have created sample and the same can be downloaded from the following link.

F53612-2063427164.zip

Please let me know if you have any other questions or concerns.

Regards,
Siva


Chloe Vuillet
Replied On August 25, 2011 12:42 AM

hi,
This does not resolve my issue.
To be more clear, I have a chartcontrol that plots different graphs depending on the button clicked on.

Problem : some graphes represent percentages on the Yaxis and others represent prices, yet if I try to limit the range of percentages to 100% (which is cleaner) it impacts the axis of my other graphs that are no longer automatically scalled according to the point values.

Questions : how can i resolve this? How can the "Windows Form Designer generated code" just define a blank chartcontrol zone and then let me define all the parameters when ploting each graph?
How can I show the last value of a line chart?
Can a watermark be behind the grid (the zOrder.behind just puts it behind the chart series)?

Thanks & Regards,
Clo


Sivakumar D [Syncfusion]
Replied On August 25, 2011 01:20 PM

Hi Clo,

We regret for the inconvenience caused.

We suggest you to use multiple axes for different graphs to scale the point values according to the graphs.Please refer the below code snippet.

[C#]

ChartAxis secYAxis = new ChartAxis(ChartOrientation.Vertical);
this.chartControl1.Axes.Add(secYAxis);
this.chartControl1.Series[0].YAxis = secYAxis;
secYAxis.Range = new MinMaxInfo(0, 100, 20);


Query#1:How can the "Windows Form Designer generated code" just define a blank chartcontrol zone and then let me define all the parameters when plotting each graph?

In our current implementation,your requirement can't be achieved to define a blank chartcontrol through windows form designer.but we can clear the default series in the chart by setting the AddRandomSeries of chartcontrol to false and clear all the default series in the chart.please refer below code snippet.

[C#]

this.chartControl1.AddRandomSeries = false;
this.chartControl1.Series.Clear();


Query#2:How can I show the last value of a line chart?

Your requirement can be achieved by getting the Point values from specific series.Please refer below code snippet.
[C#]

if (this.chartControl1.Series.Count != 0)
{
textBox1.Text = Convert.ToString(this.chartControl1.Series[0].Points[this.chartControl1.Series[0].Points.Count - 1].X);
textBox2.Text = Convert.ToString(this.chartControl1.Series[0].Points[this.chartControl1.Series[0].Points.Count - 1].YValues[0]);
}


Query#3:Can a watermark be behind the grid (the zOrder.behind just puts it behind the chart series)?

Your requirement can be achieved by set Zorder property to behind.Please refer the below code snippet.

[C#]

this.chartControl1.ChartArea.Watermark.ZOrder = ChartWaterMarkOrder.Behind;


For your convenience, we have created sample and the same can be downloaded from the following link.

Forum-1518929250.zip

Please get back to us with more information if i misunderstood your queries and updated you.

Regards,
Siva


Chloe Vuillet
Replied On August 30, 2011 11:19 PM

Hi,

"Query#3: Your requirement can be achieved by set Zorder property to behind.Please refer the below code snippet.

[C#]

this.chartControl1.ChartArea.Watermark.ZOrder = ChartWaterMarkOrder.Behind; "

==> this snippet does not work : it sets the watermark behing the chart but IN FRONT of the grid, can I put it BEHIND the grid?

Thank you


Sivakumar D [Syncfusion]
Replied On September 2, 2011 09:02 AM

Hi Clo,

Thanks for your update.

We are sorry for inconvenience caused.We are unable to reproduce the issue.We have tested the sample by removed the grid lines while adding water mark and then added the grid lines of axes to the chart.The grid lines are added infront of the water mark only.The character value of 'y','n','u' are splitted by the grid lines because of it placed behind the grid,if the watermark placed infront of the grid then Grid line will be splitted by the watermark.

For your convenience, modified modfied sample and the same can be downloaded from the following link.

Forum_Modified-1652035397.zip

Please let me know if you have any other questions or concerns.

Regards,
Siva


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;