Hello,
The below line of code is already exist in 4.2021.7.22. Now we are planning to upgrade to 4.2023.7.5 netframework48 version.
CursorTool.Pen.Style style = MovingCursorStyle;//System.Windows.Media.DashStyle
How can we assign System.Windows.Media.DashStyle to Steema.TeeChart.Drawing.DashStyle?
Thanks,
Venkat
Steema.TeeChart.Drawing.DashStyle assignment issue
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Steema.TeeChart.Drawing.DashStyle assignment issue
Hello Venkat,
here's a small example:
which here gives me:
Internally we convert System.Windows.Media.DashStyle to TeeChart.Drawing.DashStyle like this:
And SetStyle:
here's a small example:
Code: Select all
public partial class MainWindow : Window
{
private TChart _tChart1 = new TChart();
public MainWindow()
{
InitializeComponent();
grid1.Children.Add(_tChart1);
_tChart1.AfterDraw += _tChart1_AfterDraw;
}
private void _tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.IGraphics3D g)
{
g.Pen.Color = System.Drawing.Color.Red;
g.Pen.Width = 3;
g.Pen.Style = Steema.TeeChart.Drawing.DashStyle.DashDot;
g.MoveTo(10, 10);
g.LineTo(150, 150);
}
}
Code: Select all
TeeChart.Drawing.DashStyle IChartPen.Style
{
get
{
if (Style == DashStyles.Dash) return TeeChart.Drawing.DashStyle.Dash;
else if (Style == DashStyles.Dot) return TeeChart.Drawing.DashStyle.Dot;
else if (Style == DashStyles.DashDot) return TeeChart.Drawing.DashStyle.DashDot;
else if (Style == DashStyles.DashDotDot) return TeeChart.Drawing.DashStyle.DashDotDot;
else return TeeChart.Drawing.DashStyle.Solid;
}
set
{
Style = SetStyle(value);
}
}
Code: Select all
static System.Windows.Media.DashStyle SetStyle(Steema.TeeChart.Drawing.DashStyle style)
{
switch (style)
{
case TeeChart.Drawing.DashStyle.Dash:
return DashStyles.Dash;
case TeeChart.Drawing.DashStyle.Dot:
return DashStyles.Dot;
case TeeChart.Drawing.DashStyle.DashDot:
return DashStyles.DashDot;
case TeeChart.Drawing.DashStyle.DashDotDot:
return DashStyles.DashDotDot;
default:
return DashStyles.Solid;
}
}
Best Regards,
Christopher Ireland / 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 |