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

Message ListMessage List     Post MessagePost Message

  Different colors of plot area
Posted by Melih on Jul-15-2021 19:23
Attachments:
Hi! I'm using your wonderful library.
Please tell me how can I choose different colors for XYChart sections?
New Bitmap Image.bmp
New Bitmap Image.bmp

163.33 Kb

  Re: Different colors of plot area
Posted by Peter Kwan on Jul-17-2021 00:17
Hi Melih,

If you want to use a specific background color for certain x-axis range, you may use Axis.addZone. See:

https://www.advsofteng.com/doc/cdnet.htm#markzone2.htm

The exact code depends on your programming language and the type of x-coordinates. If you are using a label based x-axis (the axis is configured using Axis.setLabels), the x-coordinate is the array index of the label, not the label itself. If you are using a true date/time axis (the x-coordinates are provided using Layer.setXData). the x-coordinate is the date/time. In certain programming languages, the date/time is an object (such as System.DateTime object in .NET and java.util.Date in Java), while Axis.addZone expects floating point values. In this case, you can use Chart.CTime to convert the date/time object to a double precision value to be used for Axis.addZone.

Regards
Peter Kwan