ColorLine and Move chart
ColorLine and Move chart
Please find this example
http://193.145.251.126/pnp/files/ZQyAYs ... chart3.zip
Button1 adds a colorline in 150, if you move then the chart the color line goes out of the chart (in the screen shot you can see it below the x axis).
I see it only happnes if AllowDrop property is false
Is it a bug or can I avoid going out the chart?
Thanks
http://193.145.251.126/pnp/files/ZQyAYs ... chart3.zip
Button1 adds a colorline in 150, if you move then the chart the color line goes out of the chart (in the screen shot you can see it below the x axis).
I see it only happnes if AllowDrop property is false
Is it a bug or can I avoid going out the chart?
Thanks
- Attachments
-
- colorline.png (23.22 KiB) Viewed 14731 times
Re: ColorLine and Move chart
Hello wakeup,
To solve your problem I recommend you taking a look in this link, where you find different methods to avoid ColorLine tool drag out of bounds of chart.
I hope will helps.
Thanks,
To solve your problem I recommend you taking a look in this link, where you find different methods to avoid ColorLine tool drag out of bounds of chart.
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 |
Re: ColorLine and Move chart
The first solution is not valid because I dont want it to be dragable.
And the second doesn't run well, sometime the tool is active and it is not shown, and somtimes it is not active and it is shown. It seems it is not well refreshed the active property.
Is this issue already reported as a bug?
Thanks
And the second doesn't run well, sometime the tool is active and it is not shown, and somtimes it is not active and it is shown. It seems it is not well refreshed the active property.
Is this issue already reported as a bug?
Thanks
Re: ColorLine and Move chart
Hello wakeup,
I have modified the code and now it works in correct way:
Could you tell us if previous code works in your end?
Thanks,
I have modified the code and now it works in correct way:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
FastLine fastLine1 = new FastLine(tChart1.Chart);
var line = new ColorLine(tChart1.Chart)
{
Axis = tChart1.Axes.Left,
Pen = { Style = DashStyle.Solid, Color = Color.Red, Width = 1 },
AllowDrag = false
};
tChart1.Aspect.View3D = false;
tChart1.Header.Font.Bold = true;
tChart1.Header.Font.Size = 15;
fastLine1.FillSampleValues();
line.Value = fastLine1.YValues.Minimum - 50;
fastLine1.LinePen.Width = 1;
tChart1.AfterDraw += tChart1_AfterDraw;
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Graphics3D g)
{
for (int i = 0; i < tChart1.Tools.Count; i++)
{
Steema.TeeChart.Tools.Tool tool = tChart1.Tools[i];
if (tool is Steema.TeeChart.Tools.ColorLine)
{
if ((tool as Steema.TeeChart.Tools.ColorLine).Value < tChart1.Axes.Left.Minimum || (tool as Steema.TeeChart.Tools.ColorLine).Value > tChart1.Axes.Left.Maximum)
{
tool.Active = false;
}
else
{
tool.Active = true;
}
}
}
}
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 |
Re: ColorLine and Move chart
I did change bottom to left axis in the previous code. That is not the reason because it didn't run. The reason was sometime the tool is active and it is not shown, and sometimes it is not active and it is shown. It seems it is not well refreshed the active property. It sometimes happens in general in teechart, but I use to solve it putting a chart.refresh() in the code, but in this case I can't because it would be a infinite loop.
Is this issue already reported as a bug?
Is this issue already reported as a bug?
Re: ColorLine and Move chart
Hello wakeup,
The line of code I have added to solve the problem is next:
I realized is necessary repainting the chart after initialize AfterDraw event, so the ColorLine tool is drawing correctly and if I use tChart1.Draw() method, the active property is refreshed as I expect. Please, check my code and tell us if it help you.
Thanks,
The line of code I have added to solve the problem is next:
Code: Select all
tChart1.AfterDraw += tChart1_AfterDraw;
tChart1.Draw();
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 |
Re: ColorLine and Move chart
I follow with the same problems with that code:
I already had the instrucction
this.chart.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(this.chart_AfterDraw);
which I think is similar.
and "chart.Draw();" in the initialization doesn't do anything especial, because the refreshing problem is not in the initialization, but in the "AfterDraw" function, and in that function I cannot put the chart.Draw() instruction because it would be a infinite loop.
I already had the instrucction
this.chart.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(this.chart_AfterDraw);
which I think is similar.
and "chart.Draw();" in the initialization doesn't do anything especial, because the refreshing problem is not in the initialization, but in the "AfterDraw" function, and in that function I cannot put the chart.Draw() instruction because it would be a infinite loop.
Re: ColorLine and Move chart
Hello wakeup,
Ok. I couldn't reproduce the problem you there is with ColorLine Tool using my last code. Could you please, make a project, where your problem appears and I can reproduce it here?
Thanks,
Ok. I couldn't reproduce the problem you there is with ColorLine Tool using my last code. Could you please, make a project, where your problem appears and I can reproduce it here?
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 |
Re: ColorLine and Move chart
Here you have
http://193.145.251.126/pnp/files/QOQduc ... orline.zip
If you do zoom, and after that an uzoom, most of the times the color line is not shown.
Thanks
http://193.145.251.126/pnp/files/QOQduc ... orline.zip
If you do zoom, and after that an uzoom, most of the times the color line is not shown.
Thanks
Re: ColorLine and Move chart
Hello wakeup,
Your code need refresh the chart when you add data and do Unzoom, if you want ColorLine draw correctly. I have modified your code and it works in my end:
Could you confirm us if the code works now in your end?
Thanks.
Your code need refresh the chart when you add data and do Unzoom, if you want ColorLine draw correctly. I have modified your code and it works in my end:
Code: Select all
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
tChart1.UndoneZoom += tChart1_UndoneZoom;
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Draw();
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Series[0].FillSampleValues();
tChart1.Draw();
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
for (int i = 0; i < tChart1.Tools.Count; i++)
{
Steema.TeeChart.Tools.Tool tool = tChart1.Tools[i];
if (tool is Steema.TeeChart.Tools.ColorLine)
{
if ((tool as Steema.TeeChart.Tools.ColorLine).Value < tChart1.Axes.Left.Minimum || (tool as Steema.TeeChart.Tools.ColorLine).Value > tChart1.Axes.Left.Maximum)
{
tool.Active = false;
}
else
{
tool.Active = true;
}
}
}
}
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 |
Re: ColorLine and Move chart
Ok thanks, now it seems to run. But anyway, I think it would be better to do all this automatically, as when allowDrop is true. Would not it?
Re: ColorLine and Move chart
Hello wakeup,
Sorry for the delay. After do many test with ColorLine tool we consider your request as a bug and we have added it to bug list with number [id447]. We will try to fix it to upcoming versions of TeeChartFor.Net. Remember you can follow its status in this link. On the other hand, if you want you can sign up at bugzilla and submit and follow up issues yourself in our new bugzilla bug tracking system
Thanks,
Sorry for the delay. After do many test with ColorLine tool we consider your request as a bug and we have added it to bug list with number [id447]. We will try to fix it to upcoming versions of TeeChartFor.Net. Remember you can follow its status in this link. On the other hand, if you want you can sign up at bugzilla and submit and follow up issues yourself in our new bugzilla bug tracking system
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 |