Hello,
I have two different charts (Surface and ColorGrid) displaying same data. I customized legend (text content, font size, font color, ...)
With the surface chart all works as expected, instead with ColorGrid I'm facing a strange behaviour: changes applied on legend font are affecting also axis labels font.
I also verified (using TChart Editor) that changes carried out to Legend Text Font are applied for Surface, but not for ColorGrid.
To see changes on Legend font (for ColorGrid) I have (using TChart Editor) to modify Axes Labels Text Font.
Suggestions?
ColorGrid Legend Font
Re: ColorGrid Legend Font
Hello dauser,
I haven't reproduced your problem using next code and last version of TeeChartFor.Net:
Could you please, tell us which version of TeechartFor.Net are you using, now? On the other hand, if you use latest version and my code works in your end, please send us a simple example, because we can reproduce your problem here. On the other hand, if you don't have latest version, I recommend you test your project, using last evaluation version and check if your problem persist. You can download the evaluation version of TeeChartFor.Net here
Thanks,
I haven't reproduced your problem using next code and last version of TeeChartFor.Net:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.ColorGrid colorGrid1;
Steema.TeeChart.Styles.Surface surface1;
private void InitializeChart()
{
colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart2.Chart);
surface1 = new Steema.TeeChart.Styles.Surface(tChart3.Chart);
colorGrid1.FillSampleValues();
surface1.FillSampleValues();
tChart2.Legend.Font.Bold = true;
tChart3.Legend.Font.Bold = true;
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: ColorGrid Legend Font
Hi,
I found out that behaviour I noticed seems to be related to DrawBehind property.
If you add to your previous code the following line
you should find that changes on font attributes (bold in this case, but at the same way other font attributes like size, color, ...) are no more applied on legend text.
Reforcing font attribute changes using OnSymbolDraw event, changes are affecting also bottom axis text.
I found out that behaviour I noticed seems to be related to DrawBehind property.
If you add to your previous code the following line
Code: Select all
tChart1.Legend.DrawBehind = false;
Reforcing font attribute changes using OnSymbolDraw event, changes are affecting also bottom axis text.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
InitializeButton();
}
Steema.TeeChart.Styles.ColorGrid colorGrid1;
Steema.TeeChart.Styles.Surface surface1;
System.Windows.Forms.Button button1;
private void InitializeChart()
{
colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
surface1 = new Steema.TeeChart.Styles.Surface(tChart2.Chart);
colorGrid1.FillSampleValues();
surface1.FillSampleValues();
tChart1.Legend.DrawBehind = false;
tChart1.Legend.ResizeChart = true;
tChart2.Legend.ResizeChart = true;
tChart1.Legend.Font.Bold = true;
tChart2.Legend.Font.Bold = true;
tChart2.Legend.Font.Size = 15;
tChart1.Legend.Font.Size = 15;
tChart2.Legend.Symbol.OnSymbolDraw += new Steema.TeeChart.SymbolDrawEventHandler(Symbol_OnSymbolDraw);
tChart1.Legend.Symbol.OnSymbolDraw += new Steema.TeeChart.SymbolDrawEventHandler(Symbol_OnSymbolDraw);
}
private void InitializeButton()
{
button1 = new System.Windows.Forms.Button();
this.Controls.Add(this.button1);
//
// button1
//
this.button1.Location = new System.Drawing.Point(597, 105);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Refresh";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
}
private void Symbol_OnSymbolDraw(object sender, Steema.TeeChart.SymbolDrawEventArgs e)
{
Steema.TeeChart.Drawing.Graphics3D gr = (sender as Steema.TeeChart.LegendSymbol).Chart.Graphics3D;
gr.Font.Size = 15;
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Refresh();
tChart2.Refresh();
}
Re: ColorGrid Legend Font
Hello dauser,
I can reproduce your problem with legend and text of symbol in the bug list number(TF02016433). We will try to fix it to upcoming versions of TeeChartFor.Net(TF02016433).
Thanks,
I can reproduce your problem with legend and text of symbol in the bug list number(TF02016433). We will try to fix it to upcoming versions of TeeChartFor.Net(TF02016433).
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |