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. Image for the cookie policy date

Empty chart

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

12 Replies

PJ Poly J Syncfusion Team December 18, 2006 07:10 AM UTC

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



AN Ana December 18, 2006 09:00 AM UTC

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


AN Ana December 18, 2006 09:09 AM UTC

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


PJ Poly J Syncfusion Team December 18, 2006 01:02 PM UTC

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






AN Ana December 18, 2006 03:03 PM UTC

Hi again,

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

Best regards,
Ana


PJ Poly J Syncfusion Team December 19, 2006 03:20 AM UTC

Hi Ana,

We are glad to hear that the issue is resolved.

Best Regards,

Poly




CV Chloe Vuillet August 23, 2011 04:35 AM UTC

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



SD Sivakumar D Syncfusion Team August 23, 2011 05:47 AM UTC

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



CV Chloe Vuillet August 25, 2011 04:42 AM UTC

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



SD Sivakumar D Syncfusion Team August 25, 2011 05:20 PM UTC

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



CV Chloe Vuillet August 31, 2011 03:19 AM UTC

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



SD Sivakumar D Syncfusion Team September 2, 2011 01:02 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon