Now I'm using the following code (points >=6 should be always Gold, points >=8 should be always Tomato):
Code: Select all
using System;
using System.Drawing;
using System.Windows.Forms;
namespace TeeChartColorTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//line1.Color = line1.Pointer.Color = Color.Blue;
var rnd = new Random();
int currentValue;
for (int i = 0; i < 20; i++)
{
currentValue = rnd.Next(11);
if (currentValue >=8)
line1.Add(i, currentValue, i.ToString(), Color.Tomato);
else
if (currentValue >= 6)
line1.Add(i, currentValue, i.ToString(), Color.Gold);
else
line1.Add(i, currentValue, i.ToString(), line1.Pointer.Color);
}
}
private void tChart1_ClickLegend(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
colorDialog1.Color = line1.Color;
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
for (int i = 0; i < line1.Count; i++)
//change point colors (except for Tomato and Gold)
if (line1[i].Color == line1.Color)
line1[i].Color = colorDialog1.Color;
line1.Color = line1.Pointer.Color = colorDialog1.Color;
}
}
}
}
}
With commented line it works as expected:
Changing color to cyan:
But when I uncomment that line (where I manually change line color to Blue) - all point are Blue despite I'm setting every point color explicitly in the Add function:
P.S.
1) As far as I understand
Steema.TeeChart.Styles.Line.Color is default color for line,
Steema.TeeChart.Styles.Line.Pointer.Color is default color for line points, line1
.Color (Steema.TeeChart.Styles.SeriesXYPoint.Color) is color of a given point (in case I explicitly set color in the last parameter of the Add function).
But what Steema.TeeChart.Styles.Line.Brush.Color, Steema.TeeChart.Styles.Line.Brush.ForegroundColor and Steema.TeeChart.Styles.Line.LinePen.Color stands for? Do I need to set them when I change line color via ColorDialog?
2) I still have some chart print requirements that are critical for our software (access to zoom property for printer and dashed grid poor print quality). I've asked about current progress here, but got no answer.