Steema.TeeChart.NET(4.2022.10.11)
Hello Christopher
I want to use checkbox for legend,
I can't see the checkbox in the legend.
And if I remove the annotation and bar1 and bar2 have the 0th value, it works well.
However, when there is no 0th value, there is a problem with the 0th bar position, and there is a problem with the sort of the 2nd bar.
Is this a bug?
Please check it.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Bar bar1;
private Steema.TeeChart.Styles.Bar bar2;
private Steema.TeeChart.Styles.Bar bar3;
private void InitializeChart()
{
this.bar1 = new Steema.TeeChart.Styles.Bar();
this.bar2 = new Steema.TeeChart.Styles.Bar();
this.bar3 = new Steema.TeeChart.Styles.Bar();
this.bar1.Brush.Color = Color.Red;
this.bar1.Title = "bar1";
this.bar1.XValues.DataMember = "X";
this.bar1.YValues.DataMember = "Bar";
this.bar1.Marks.Visible = false;
this.bar2.Brush.Color = Color.Green;
this.bar2.Title = "bar2";
this.bar2.XValues.DataMember = "X";
this.bar2.YValues.DataMember = "Bar";
this.bar2.Marks.Visible = false;
this.bar3.Brush.Color = Color.Blue;
this.bar3.Title = "bar3";
this.bar3.XValues.DataMember = "X";
this.bar3.YValues.DataMember = "Bar";
this.bar3.Marks.Visible = false;
this.tChart1.Series.Add(this.bar1);
this.tChart1.Series.Add(this.bar2);
this.tChart1.Series.Add(this.bar3);
bar1.MultiBar = Steema.Teechart.Styles.MultiBars.Stacked;
//bar1.Add(0,0);
bar1.Add(1,100);
bar1.Add(2,100);
//bar2.Add(0,0);
bar2.Add(1,90);
bar2.Add(2,90);
bar3.Add(0,70);
bar3.Add(1,70);
bar3.Add(2,70);
tChart1.Legend.CheckBoxes = true;
var assembly = Assembly.GetAssembly(typeof(TChart));
var fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
tChart1.Header.Text += $" version {fvi.FileVersion}";
}