Click here to Skip to main content
15,921,643 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

When i try to use below code

MIDL
ChartType = "line";
           chart1.ChartAreas["Default"].AxisX.ArrowStyle = AxisArrowStyle.SharpTriangle;
           chart1.ChartAreas["Default"].AxisY.ArrowStyle = AxisArrowStyle.SharpTriangle;


I get the following exception, what could be the problem ??

A chart element with the name 'Default' could not be found in the 'ChartAreaCollection'.
---- thanks in advance ---------
Posted
Updated 1-Feb-11 19:21pm
v2

Make sure an area named 'Default' does exist in the chart areas collection of chart1.
Either this is completely missing or the name is different.
 
Share this answer
 
Comments
arunmj 2-Feb-11 1:24am    
I have added the default in the chart1. ok,,i will check once .
arunmj 2-Feb-11 1:43am    
chartarea collection count is zero ? ,,wat to do ?
When designing your chart in the WinForms designer, you must modify the property called ChartAreas. The default area that is created is called "Default". You seem to have changed it to something different. So what you could do is: Change "Default" in your code or just rename the chart area in your designer to "Default"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900