Hello all,
I am using Barjoin.
I have a need to not show the Barjoin line when data for that bar/point is null. Corresponding bar comes as blank but the barjoin line joins to the last drawn point. Here are the actual snapshot and the way I want. Please let me know if this is posssible.
Do not paint for Barjoin line
Do not paint for Barjoin line
- Attachments
-
- My need.
- modified.JPG (17.87 KiB) Viewed 3714 times
-
- Actual
- original.JPG (18.21 KiB) Viewed 3693 times
Re: Do not paint for Barjoin line
Hello Amit,
I am afraid isn't possible do it directly. I have made a simple code, where I have used SetNull points and three series to achieve as you want:
Can you tell us if previous code works in your end?
I hope will helps.
Thanks,
I am afraid isn't possible do it directly. I have made a simple code, where I have used SetNull points and three series to achieve as you want:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.BarJoin Series1, Series3;
Steema.TeeChart.Styles.Bar Series2;
private void InitializeChart()
{
//TChart
tChart1.Aspect.View3D = false;
//Series
Series1 = new Steema.TeeChart.Styles.BarJoin(tChart1.Chart);
Series2 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
Series3 = new Steema.TeeChart.Styles.BarJoin(tChart1.Chart);
//Add values to Series;
Random rnd = new Random();
Series1.FillSampleValues(6);
Series1.Color = Color.Red;
Series2.DataSource = Series1;
Series2.Color = Series1.Color;
Series3.DataSource = Series1;
Series3.Color = Series1.Color;
Series1.Marks.Visible = false;
Series2.Marks.Visible = false;
Series3.Marks.Visible = false;
tChart1.Legend.LegendStyle = LegendStyles.Values;
tChart1.Draw();
for (int i = 0; i < 6; i++)
{
if (i < 2)
{
Series2.SetNull(i);
Series3.SetNull(i);
}
else if (i == 2)
{
Series1.SetNull(i);
Series3.SetNull(i);
}
else if (i > 2)
{
Series1.SetNull(i);
Series2.SetNull(i);
}
tChart1.Legend.Symbol.OnSymbolDraw += new SymbolDrawEventHandler(Symbol_OnSymbolDraw);
}
}
void Symbol_OnSymbolDraw(object sender, SymbolDrawEventArgs e)
{
//Paint null symbols of legend.
tChart1.Graphics3D.Brush.Color = Color.Red;
tChart1.Graphics3D.Rectangle(e.Rect);
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
I hope will helps.
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 |