|
Strange behavior of the chart in Excel |
Posted by ALEX on Dec-09-2011 22:24 |
|
1, When you manually add a chart in Excel get the following window: 1
2, When you add a programmatic add a chart in Excel get the following window: 2
1, In the present one inscription ChartDirector Chart Viewer. Appears if you manually add a chart to a worksheet and then programmatically add data.
2, In the two there is only the area under the chart, but the diagram itself is not present, if we construct a chart of all programmatic. BUT if you go for example on Sheet2 and then return to Sheet1 - chart appears.
What is it? This can be avoided?
I am testing ChartDirector for ASP / COM / VB for Windows XP and Excel 2010.
Thank you in advance for your help
|
Re: Strange behavior of the chart in Excel |
Posted by Peter Kwan on Dec-10-2011 04:27 |
|
Hi ALEX,
Is it possible to email me an example Excel spreadsheet that can illustrate the problem? My email is pkwan@advsofteng.net
Regards
Peter Kwan |
Re: Strange behavior of the chart in Excel |
Posted by ALEX on Dec-10-2011 04:56 |
|
Hi Peter
This is not a problem but the problem is that when you reopen an Excel file, the inscription on the chart "ChartDirector Chart Viewer" disappears. I'll record a video that illustrates the problem and lay out the source code, even though he was of the standard examples. |
Re: Strange behavior of the chart in Excel |
Posted by ALEX on Dec-13-2011 03:17 |
|
Hi Peter
There is a solution to my problem? |
Re: Strange behavior of the chart in Excel |
Posted by Peter Kwan on Dec-13-2011 04:07 |
|
Hi ALEX,
You see a blank region instead of the "ChartDirector Chart Viewer" because your Spreadsheet is running (it is at runtime, not design time). This is the normal behaviour in all programming environments.
For controls, there is a concept of "design time" vs the "runtime". In IDE programming environments (such as VB, VBA, etc), during design time, you can add and position the controls, there may be a "Property" window that allow you to set control properties, and you can use the IDE to develop code. Because your code is still under development and is not running, so the ChartViewer will show a dummy image with the text "ChartDirector Chart Viewer". This is to allow you to identify the control at design time.
When you actually run the program, the ChartViewer will show the chart you set to it, and should not display the dummy image with the text "ChartDirector Chart Viewer". It is because the developer should not want the end user to see the development environment. If you do not set anything to the ChartViewer, it will be blank. (Are you seeing the ChartViewer blank only if your code do not set a chart to it?)
If you want to show something else, your code would need to set the picture or chart you want to show to the ChartViewer. You may set a dummy picture to it if you like. If you want to show something when the spreadsheet first loaded, you may put the code in the work book load event.
So in short, if your code can run (which means you are in runtime, not design time), your code will need to control what is shown in ChartViewer. The ChartViewer will not show the design time image.
One abnormal behaviour I see in your video is that there is a "ChartDirector Chart Viewer" text shown on the chart. The correct behaviour is that no such text should appear if you can see the chart. (If you can see the chart, it is at runtime, so no such text should appear.)
From the video, the above occurs if you add the ChartViewer to the spreadsheet (therefore it is at design time), and then immediately run the code (and therefore switch to runtime). It seems Excel 2010 can switch from design time to runtime instantly without re-initializing the control, so the ChartViewer is confused if it is in design time or runtime. (In older versions of Excel as well as VB6 and other development environments, switching from design time to runtime will cause the control to re-initialize.)
When you save the file and open it again, the Excel re-initialize the control and it should show the normal behaviour (without the "ChartDirector Chart Viewer" text).
As the above only occurs when you first added a ChartViewer to the spreadsheet and only at design time, would this still be a concern for your case (or would you prefer not to see the "ChartDirector Chart Viewer" text)?
Regards
Peter Kwan |
Re: Strange behavior of the chart in Excel |
Posted by ALEX on Dec-13-2011 04:38 |
|
Thanks Peter, I understand you
If the inscription "ChartDirector Chart Viewer" appears only when I first add and more appear remarks will not be - then the problem is cleared.
p.s. - and I can remove the "ChartDirector Chart Viewer" text in the first and add a chart? |
Re: Strange behavior of the chart in Excel |
Posted by Peter Kwan on Dec-14-2011 03:28 |
|
Hi ALEX,
If the ChartViewer is added manually using standard Excel features, the "ChartDirector Chart Viewer" text will appear initially. If it is added programmatically as mentioned in your earlier message, if the container is set to runtime mode when you add the control, the text will not appear.
(I am not sure how you add the control programmatically, so I am not sure if you can control the design time or runtime mode. The ChartViewer determines whether it is in design time or runtime by asking the container when the ChartViewer is initializing. So if you can set the container to runtime mode before adding the ChartViewer, there will be no "ChartDirector Chart Viewer" text.)
If the above method is not feasible, I can ask our developer to modify our code and issue an update to you. We probably will modify the ChartViewer so that it will switch to runtime mode if a chart image is set it, regardless of what is the mode of the container. (If the chart image is set, obviously some code is running.) This should solve the problem. Please let me know if you need the update.
Hope this can help.
Regards
Peter Kwan |
Re: Strange behavior of the chart in Excel |
Posted by ALEX on Dec-14-2011 03:49 |
|
Peter, thank you very much for the help. Do you have the best customer service, with which I have ever dealt with.
The update is not necessary. |
|