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

Message ListMessage List     Post MessagePost Message

  Arbitrary XY chart - formatting options
Posted by joe on May-04-2011 05:23
Attachments:
Hello,
I am creating an arbitrary XY chart in PHP. I have attached an image of my generated chart. I would like the vertical lines that appear through a data point to be a light gray (same as horizontal lines) while my text remains black. This is highlighted in red. I would also like to see how to remove any vertical lines (blue circle) unless they correspond with a data point. Thank you.

Code to generate labels are below

#-------------------------------------------------------------------------------
$c->xAxis->setLabelFormat("~"); //DISABLE AUTO SCALE LABELS
#-------------------------------------------------------------------------------
for ($a = 0; $a < count($base_x); $a++)//THIS ADDS ONLY LABELS FOR ACTUAL SUBMISSION DATES
{
#-------------------------------------------------------------------------------
$markObj = $c->xAxis->addMark($base_x[$a], 0x000000, $c->formatValue($base_x[$a], "{value|yyyy-mm-dd}"));
$markObj->setFontAngle(-90);
#-------------------------------------------------------------------------------
chart_director_help.2.GIF

  Re: Arbitrary XY chart - formatting options
Posted by Joe on May-04-2011 22:22
One thing I forgot to mention, I would like the lines to appear under the actual symbol.

  Re: Arbitrary XY chart - formatting options
Posted by Peter Kwan on May-04-2011 22:36
Hi Joe,

You may use Mark.setMarkColor to set different colors for the mark line and the text. You may use Mark.setDrawOnTop to set the mark not to draw on top (to draw under the symbols). For example:

$markObj = $c->xAxis->addMark($base_x[$a], -1, $c->formatValue($base_x[$a], "{value|yyyy-mm-dd}"));

$markObj->setMarkColor(0xcccccc, 0x000000);
$markObj->setDrawOnTop(false);

The vertical grid lines in your chart should be "minor grid lines". (The setLabelFormat only configures the major grid lines which are associated with labels.) By default, there should be no vertical grid lines (major or minor) on the chart, because their default color is transparent. If there are vertical grid lnes, I think your code may have set a color for the vertical grid lines (in setPlotArea).

For your case, if you do not want any automatic grid lines or labels at all, please set them to transparent. For example:

# Set the plotarea at (60, 80) and of 510 x 275 pixels in size. Use grey 0xcccccc border,
# grey 0xcccccc horizontal grid lines, and no vertical grid lines
$plotArea = $c->setPlotArea(60, 80, 510, 275, -1, -1, Transparent,  0xcccccc, 0xcccccc, Transparent);

#Set the automatic labels to transparent too.
$c->xAxis->setLabelStyle("", 8, Transparent);

Hope this can help.

Regards
Peter Kwan