Repainting Chart
Repainting Chart
Hi
Designing in Visual Basic.
I need to know how to refresh my chart.
1) Chart is open in a form
2) Data read into Series0 using the dataset.
Now data changes in the table, but I dont seem to be able to get the Chart to repaint the new data unless I close and reopen the form.
Tried tchart1.repaint on a button click event, but doesnt refresh.
Any ideas please.
Thanks
Designing in Visual Basic.
I need to know how to refresh my chart.
1) Chart is open in a form
2) Data read into Series0 using the dataset.
Now data changes in the table, but I dont seem to be able to get the Chart to repaint the new data unless I close and reopen the form.
Tried tchart1.repaint on a button click event, but doesnt refresh.
Any ideas please.
Thanks
Re: Repainting Chart
Hello Digitec,
If you want refresh data, you must use property of series CheckDataSource as do in below lines of code:
But if you want redraw the chart, you need use TChart.Environment.InternalRepaint method that as do in next lines:
I hope will helps.
Thanks,
If you want refresh data, you must use property of series CheckDataSource as do in below lines of code:
Code: Select all
TChart1.Series(0).CheckDataSource
Code: Select all
TChart1.Environment.InternalRepaint
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: Repainting Chart
Hi Sandra
Thanks for the post, but that didnt help.
I have setup a test access database. In there i have a table with 10 X and Y values.
I drop the activex teechart onto a form and the edit the the control so it is using a Dataset in Series0.
I then generate a bar chart showing all the values. That all works fine.
Now, if a value in the X column of the table changes, how do I show that change on the chart with a refresh option.
At the moment, the only way is to close the form and reopen to show the new values.
Any ideas? Thanks in advance...
Thanks for the post, but that didnt help.
I have setup a test access database. In there i have a table with 10 X and Y values.
I drop the activex teechart onto a form and the edit the the control so it is using a Dataset in Series0.
I then generate a bar chart showing all the values. That all works fine.
Now, if a value in the X column of the table changes, how do I show that change on the chart with a refresh option.
At the moment, the only way is to close the form and reopen to show the new values.
Any ideas? Thanks in advance...
Re: Repainting Chart
In addition, I added 2 buttons to the forms.
One clears the chart, this works using TChart4.Series(0).Clear
The other button should show the new underlying data using TChart4.Series(0).CheckDataSource.
But it doesnt, the old data is shown.
Any help would be appricated....
One clears the chart, this works using TChart4.Series(0).Clear
The other button should show the new underlying data using TChart4.Series(0).CheckDataSource.
But it doesnt, the old data is shown.
Any help would be appricated....
Re: Repainting Chart
Hello Digitec,
Could you send please a simple project we can reproduce exactly your problem here?
Thanks,
Could you send please a simple project we can reproduce exactly your problem 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: Repainting Chart
File attached in next post:
Description of zip file:
1) Contains teedata.mdb
2) Contains teechart.mdb
Teedata.mdb contains a simple table with 2 columns and 10 rows of data. for X and Y values.
Teechart.mdb contains a linked table to teedata.mdb, also a single form with bar chart and 2 buttons.
Button1 clears screen/data - works fine
Button2 reloads the data - does not upload change data in table.
With the chart open, I change some data in the count field and click the Reload button.
New data is not displayed, only old values are dispalyed. It is almost as if it is caching the old series.
Any ideas?
Description of zip file:
1) Contains teedata.mdb
2) Contains teechart.mdb
Teedata.mdb contains a simple table with 2 columns and 10 rows of data. for X and Y values.
Teechart.mdb contains a linked table to teedata.mdb, also a single form with bar chart and 2 buttons.
Button1 clears screen/data - works fine
Button2 reloads the data - does not upload change data in table.
With the chart open, I change some data in the count field and click the Reload button.
New data is not displayed, only old values are dispalyed. It is almost as if it is caching the old series.
Any ideas?
- Attachments
-
- teechart.zip
- (29.39 KiB) Downloaded 734 times
Re: Repainting Chart
llo Digitec,
Thanks for your project solution, but It doesn't run for me. Please, you could explain step to step, how we do for reproduce your project, so we try to reproduce it and try to help you to solve your problem.
Thanks,
Thanks for your project solution, but It doesn't run for me. Please, you could explain step to step, how we do for reproduce your project, so we try to reproduce it and try to help you to solve your problem.
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: Repainting Chart
Your chart doesnt seem to allow for a simple refresh on the data.
1) I have an msaccess form with a bar chart and 2 buttons.
2) I have a table with 2 columns and 10 rows of data - represents X and Y values for bar chart.
3) The bar chart is being populated via your datasource option and using the dataset option within the series0.
4) The form is opened and the chart populates.
5) I know edit some data in the table.
6) I want this new data to appear on the chart.
7) I click a button to reload, the click event has this code:
Private Sub Command2_Click()
TChart0.Series(0).CheckDataSource
End Sub
The chart does not repaint with the new data.
9) If I close the form down and re-open, the chart will now show the new data. So how do I get the chart to refesh with the new data without closing and reopening the form.
1) I have an msaccess form with a bar chart and 2 buttons.
2) I have a table with 2 columns and 10 rows of data - represents X and Y values for bar chart.
3) The bar chart is being populated via your datasource option and using the dataset option within the series0.
4) The form is opened and the chart populates.
5) I know edit some data in the table.
6) I want this new data to appear on the chart.
7) I click a button to reload, the click event has this code:
Private Sub Command2_Click()
TChart0.Series(0).CheckDataSource
End Sub
The chart does not repaint with the new data.
9) If I close the form down and re-open, the chart will now show the new data. So how do I get the chart to refesh with the new data without closing and reopening the form.
Re: Repainting Chart
Hello Sandra
Any solution, I need to know this before my right to return of your software option runs out.
Any solution, I need to know this before my right to return of your software option runs out.
Re: Repainting Chart
Hi Sandra
I dont appear to be getting any support from your company.
Please see my previous posts and answer to your questions.
I dont appear to be getting any support from your company.
Please see my previous posts and answer to your questions.
Re: Repainting Chart
Hello Sandra
I have been waiting 4 days for an answer to what I think should be a pretty straight forward function in your activex control.
As you represent Steema on technical support, do you think you can provide me with an answer.
Thank you....
I have been waiting 4 days for an answer to what I think should be a pretty straight forward function in your activex control.
As you represent Steema on technical support, do you think you can provide me with an answer.
Thank you....
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Repainting Chart
Hello Digitec,
I'd like to apologise if you got the impression your posts are ignored, they aren't. Your last reply on this issue was on Friday afternoon around 15:00 CET. Steema Software's support staff doesn't work on weekends so from that I assume that less than 2 working days have passed since. We try to reply on a timely fashion to all technical support inquiries and will try to provide an answer to yours along the day.
Thanks for your patience and understanding.
I'd like to apologise if you got the impression your posts are ignored, they aren't. Your last reply on this issue was on Friday afternoon around 15:00 CET. Steema Software's support staff doesn't work on weekends so from that I assume that less than 2 working days have passed since. We try to reply on a timely fashion to all technical support inquiries and will try to provide an answer to yours along the day.
Thanks for your patience and understanding.
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 |
Re: Repainting Chart
Hello,
first of all, sorry for delay !
Here the answer to your question, hope that it helps. In order refresh the data provided by a DataSet, as datasource, you have to reasign the DataSource once a record have been updated (added, modified, deleted) by code. Here an example of code :
Please, do not hesitate to contact us in case we can be of any further help.
first of all, sorry for delay !
Here the answer to your question, hope that it helps. In order refresh the data provided by a DataSet, as datasource, you have to reasign the DataSource once a record have been updated (added, modified, deleted) by code. Here an example of code :
Code: Select all
TChart1.Series(0).DataSource = "DSN=TeeChart Pro Database; TABLE=Employee"
TChart1.Series(0).CheckDataSource
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Repainting Chart
Thank you for your answer.
Ill try this today and provide feedback.
Again, thank you.
Ill try this today and provide feedback.
Again, thank you.
Re: Repainting Chart
HI, just to confirm that all is OK now.
Thank you for your help.
Thank you for your help.