Posted 26 June 2022, 11:58 pm EST
- Updated 3 October 2022, 1:23 pm EST
Hi.
Sorry, probably I was not clear. There is 3 buttons with basically the same behaviour adding same data. When you click on “ok” button then empty chart is displayed, you then click “show points” button and see data, eveything is fine. Both error btns click follows the same pattern except that I initially add data and try to show chart (with added data) and then exception is raised (Exception thrown: ‘System.OverflowException’ in System.Drawing.dll). Put it simply, on my desktop I see attached image and message in output window(Exception thrown: ‘System.OverflowException’ in System.Drawing.dll)
I uploaded modified version of my example which removes “show points” btn in case of “error” or “error2” btn clicked to remove confusion. Of course there will be exception because this data is already added. It is just for demonstation purposes.
Put iit simple, given code:
public Form1(bool add=false)
{
InitializeComponent();
chartUserControl2.ComponentName = "X";
if (add) AddPos();
}
public void AddPos()
{
chartUserControl2.AddPositions(_pos);
}
.....
private void okButton_Click(object sender, EventArgs e)
{
var f1 = new Form1();
f1.Show(); [b]//then call show btn and everything is ok[/b]
}
private void errButton_Click(object sender, EventArgs e)
{
var f1 = new Form1(true);
f1.showPointsBtn.Visible = false;
try
{
f1.Show(); [b]//I see attached image[/b]
}
catch(Exception exception)
{
Debug.WriteLine(exception);
}
}
private void err2Button_Click(object sender, EventArgs e)
{
var f1 = new Form1();
f1.showPointsBtn.Visible = false;
try
{
f1.Show();
f1.AddPos(); [b]//I see attached image[/b]
}
catch(Exception exception)
{
Debug.WriteLine(exception);
}
}
Does it make sense now?
My flex chart version is 4.5.20211.492 (and all other c1 controls).
C1ChartTest.zip