Series Marks Text formatting issues
Posted: Fri Oct 26, 2012 7:33 am
Hi,
I'm facing issues when trying to format the Text displayed in the Series Marks.
series.Marks.TextAlign = StringAlignment.Near; should align the text in the series marks to left for my locale. But it always aligns it to center.
Also, I'm not sure how the series marks can be formatted with HTML tags.
series.Marks.TextFormat = Steema.TeeChart.Drawing.TextFormat.Html; is also not taking effect.
Here is the sample code:
Here is the screenshot:
Please advise me on this.
Thanks.
I'm facing issues when trying to format the Text displayed in the Series Marks.
series.Marks.TextAlign = StringAlignment.Near; should align the text in the series marks to left for my locale. But it always aligns it to center.
Also, I'm not sure how the series marks can be formatted with HTML tags.
series.Marks.TextFormat = Steema.TeeChart.Drawing.TextFormat.Html; is also not taking effect.
Here is the sample code:
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Steema.TeeChart.Styles;
using Steema.TeeChart.Tools;
namespace TooltipTest
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
tChart1.Aspect.View3D = false;
}
private void Form2_Load(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Automatic = false;
tChart1.Axes.Bottom.SetMinMax(DateTime.Now, DateTime.Now.AddHours(1));
tChart1.Axes.Left.SetMinMax(0, 50);
ImagePoint series = new ImagePoint(tChart1.Chart);
series.Pointer.HorizSize = 16;
series.Pointer.VertSize = 16;
series.Add(DateTime.Now.AddMinutes(20), 10, "Test1\r\nTest12\r\nTest123");
series.Add(DateTime.Now.AddMinutes(30), 30, "<html><b>Bold Text</b><br><u>Underlined Text</u></html>");
//This should left align the text in the Series Marks; but not happening
series.Marks.TextAlign = StringAlignment.Near;
//This is not taking effect; how should I format the text, so that the HTML formatting works properly ?
series.Marks.TextFormat = Steema.TeeChart.Drawing.TextFormat.Html;
series.Marks.OnTop = true;
series.Marks.Visible = true;
series.Marks.ArrowLength = 10;
series.Marks.Style = MarksStyles.Label;
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
tChart1.Legend.Visible = false;
}
}
}
Thanks.