Problem with legend series title updation
Posted: Tue Aug 17, 2010 7:05 am
Hi,
We are trying to upgrade our application from TeeChart v2 to TeeChart v4. We are facing a problem in Steema Tee Chart v4 that was working correctly in TeeChart v2.
There is a combo box containing various names of properties. On selecting any property in the combo box the legend series should display the properties name as series title. For the first time when the chart is drawn the title is shown correct as shown in ScreenShot1.jpg while the series title on the legend does not get updated with the series name as shown in ScreenShot2.jpg. Snapshots are attached for the same.
The code for the selection change is pasted below:
We are trying to upgrade our application from TeeChart v2 to TeeChart v4. We are facing a problem in Steema Tee Chart v4 that was working correctly in TeeChart v2.
There is a combo box containing various names of properties. On selecting any property in the combo box the legend series should display the properties name as series title. For the first time when the chart is drawn the title is shown correct as shown in ScreenShot1.jpg while the series title on the legend does not get updated with the series name as shown in ScreenShot2.jpg. Snapshots are attached for the same.
The code for the selection change is pasted below:
Code: Select all
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int PropIndex = comboBox1.SelectedIndex;
tChart1.Series[0].Clear();
tChart1.Series[0].ShowInLegend = false;
for(int i=0;i<5;i++)
{
switch(PropIndex)
{
case 0:
{
tChart1.Series[0].Title = "Oil Sat";
tChart1.Series[0].Add(oilValues[i], i, Color.Brown);
break;
}
case 1:
{
tChart1.Series[0].Title = "Gas Sat";
tChart1.Series[0].Add(gasValues[i], i, Color.Green);
break;
}
case 2:
{
tChart1.Series[0].Title = "Water Sat";
tChart1.Series[0].Add(waterValues[i],i,Color.Blue);
break;
}
}
}
tChart1.Series[0].ShowInLegend = true;
tChart1.Refresh();
}