Series marks
Series marks
There are different styles you can choose from for your marks. But here is my puzzle: "Value" and "Label" seem to produce the same marks, so why I would like to use "Label and Value" style? It is just useless. Another observation: "X value" and "X and Y values" work just fine for "normal" series. But if I have horizontal bar, area or line series I again am back to x value duplicated. So for those series, how can I show both coordinates without any custom code and catching any events?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi UserLS,
An option is doing this:
Another one is customizing marks using the GetSeriesMark event:
No, this can be used when you have a string label for each point in the series, for example:There are different styles you can choose from for your marks. But here is my puzzle: "Value" and "Label" seem to produce the same marks, so why I would like to use "Label and Value" style? It is just useless.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Marks.Visible = true;
line1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelValue;
Random y = new Random();
for (int i = 0; i < 10; i++)
{
line1.Add(y.Next(), "point " + (i + 1).ToString());
}
}
This is a bug which I have added to the list to be fixed (TF02013685). There's no way of achieving that without using events nor custom code.Another observation: "X value" and "X and Y values" work just fine for "normal" series. But if I have horizontal bar, area or line series I again am back to x value duplicated. So for those series, how can I show both coordinates without any custom code and catching any events?
An option is doing this:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.HorizLine horizLine1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
horizLine1.Marks.Visible = true;
horizLine1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Label;
horizLine1.FillSampleValues();
for (int i = 0; i < horizLine1.Count; i++)
{
horizLine1.Labels[i] = horizLine1.YValues[i].ToString() + " - " + horizLine1.XValues[i].ToString();
}
}
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.HorizLine horizLine1 = new Steema.TeeChart.Styles.HorizLine(tChart1.Chart);
horizLine1.Marks.Visible = true;
horizLine1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Label;
horizLine1.FillSampleValues();
horizLine1.GetSeriesMark += new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(horizLine1_GetSeriesMark);
}
void horizLine1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
e.MarkText = series.YValues[e.ValueIndex].ToString() + " - " + series.XValues[e.ValueIndex].ToString();
}
Best Regards,
Narcís Calvet / 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 |