ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  altBgColor
Posted by Daniel on Nov-16-2011 03:34
Attachments:
Hi,

I have the following code in c#:
c.setPlotArea(40, 15, 900, 200, 0xf8f8f8, 0xffffff, Chart.Transparent,
c.dashLineColor(0x888888, Chart.DotLine));

However, I do not get alternating background, it is all white.

Can you assist?

Daniel
Chart-NoAltBGround.png

  Re: altBgColor
Posted by Peter Kwan on Nov-17-2011 02:23
Hi Daniel,

The image file you attached does not seem to be directly created by ChartDirector. It seems to be a screen shot, and then probably another program (such as Windows Paint or Photoshop) is used to create the PNG from the screen shot.

One special feature in your image is that it contains less than 256 colors, and that the colors seem to be modified and not the true original color. For example, the color of the dash line is not 0x888888, but is 0x8c8c8c. One possibility is that your code asks ChartDirector to output the chart in 256 color mode. If the original chart has more than 256 colors, ChartDirector will be forced reduce the chart to 256 colors. It means some colors may be discarded, and some colors may be "merged" into a single color. It is possible the color 0xf8f8f8 is simply discarded or it is merged into 0xffffff and become indistinguishable from 0xffffff.

Another possibility is that the chart does contain more than 256 colors, but the program you use to save the screen shot reduce it to 256 colors (and therefore discard and modify some colors).

ChartDirector will be forced to use 256 colors if:

(a) Your code uses an output format that only supports 256 colors - such as GIF. If this is the case, please use another format that can support more than 256 colors, such as JPEG or PNG.

(b) Your code uses single color transparency (such as configuring a certain color to mean transparent), which only works for 256-color images. If this is the case, please consider to use alpha transparency (which works only with PNG), or consider not to use transparency in the output (eg. set the chart background to the same color as the web page background).

(c) Your code explicitly asks ChartDirector to use "palette" mode by using DrawArea.setPaletteMode. If this is the case, please do not use palette mode.

If the above still does not solve the problem, is it possible to inform me the complete charting code, and also the exact image created by ChartDirector (not from a screen shot)? If it is a web application, you can right-click on the image and choose "Save As" to save the exact image. I will try to see if I can reproduce the problem.

Regards
Peter Kwan