|
Grid lines suddenly show on all charts |
| Posted by dejan on Aug-21-2026 11:50 |
|
The same code runs for years and generates charts first week of the month.
Also, there was not any update to chart director component.
Charts started showing grid lines as well as lines data table below chart disappeared.
Grid color is set to cd.Transparent as shown below
PlotEdgeColor = cd.Transparent
PlotGridColor = cd.Transparent
call c.setPlotArea(PlotAreaLeft, PlotAreaTop, PlotAreaWidth, PlotAreaHeight, PlotBGColor, -1, PlotEdgeColor, PlotGridColor, PlotGridColor)
Chart generated in June and July are attached so you may see the difference.
The code to generate these charts is quite complex since I use singe procedure to generate 15+ different chart styles (bars, lines, double bars, all previous with data table, ...)
What might be the issue here? I tested very simple code and I could not replicate the issue.
|
Re: Grid lines suddenly show on all charts |
| Posted by Peter Kwan on Aug-21-2026 22:35 |
|
Hi Dejan,
The grid line color can be configured by setPlotArea. It can also be configured by PlotArea.setGridColor. See:
https://www.advsofteng.com/doc/cdcom.htm#PlotArea.setGridColor.htm
Please check if there are other lines in your code that calls setGridColor.
The cd.Transparent should be equal to &HFF000000 (or -16777216 in decimal). Please try to enter it directly to the code to see if there is any change:
call c.setPlotArea(PlotAreaLeft, PlotAreaTop, PlotAreaWidth, PlotAreaHeight, PlotBGColor, -1, PlotEdgeColor, &HFF000000, &HFF000000)
To further troubleshoot, you can double check what is PlotGridColor by display it in the chart title:
' Use the following line as the chart title to display the colors
Call c.addTitle("PlotGridColor=" & PlotGridColor & ", cd.Transparent=" & cd.Transparent, "Arial Bold", 12, &H555555)
You can also try other colors just to confirm if the colors come from PlotGridColor:
' If the color is from PlotGridColor, the grid lines should be red
PlotGridColor = &HFF0000 'Red color
In general, you can modify some code that can make visible changes (such as the code that sets the grid line color for the table) just to confirm if it works as expect.
It is possible to change the value of cd.Transparent. For example, the code "cd.Transparent = 0" will set it to 0. Please check if there is any code that accidentally change assign values to cd.Transparent.
If ChartDirector is used for IIS web applications, sometimes IIS will automatically cache the ChartDirector.API object. So when you call [Set cd = CreateObject("ChartDirector.API")], IIS may reuse an old object rather than create a new one. If the old object happens to be corrupted or the cd.Transparent is being set to another value by some code, it may afffect other web pages that reuse the same object. As a last resort, try to reset the IIS. From the Admin command prompt, enter "iisreset", then enter "net start w3svc".
Best Regards
Peter Kwan |
Re: Grid lines suddenly show on all charts |
| Posted by Peter Kwan on Aug-21-2026 22:49 |
|
Hi Dejan,
I examine your chart image in detail. It is a JPEG image, and the grid lines are black, which is the color &H000000. In VBScript, an undefined variable will be considered as 0 in numeric context. If the variables are misspelled, they become undefined and will reproduce the same issue.
Best Regards
Peter Kwan |
Re: Grid lines suddenly show on all charts |
| Posted by dejan on Aug-24-2026 21:03 |
|
Peter,
Thank you for your response. Fortunately, as of today everything is back to normal, charts are generating properly without any code modification.
I guess there was some temporary glitch in the system, probably caused by windows updates. I was able to track down charts generated daily and found out the issue started on July 20 and everything as back to normal on August 17.
Concidentally, I see 4 Windows patches on very same day, August 17.
In any case, thank you for the quick response and debug suggestions.
Dejan |
|