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

Message ListMessage List     Post MessagePost Message

  Chart Legend Showing Symbols
Posted by Rob on May-22-2012 23:03
Hello,
In PHP I am making an arbitrary XY line chart. I do not want the symbol for a trend to show up on the actual chart, but I want it to appear in the Chart Legend, what is the best method?

$TotalLayerLabel = $c->addLineLayer($DataY,$Color,$TrendLabel);
$TotalLayerLabel->setXData($DataX);

$getDataSetObj = $TotalLayerLabel->getDataSet(0);
$getDataSetObj->setDataSymbol($Symbol,14);

I am passing an empty space as "$Symbol" so that no symbol appears on the chart trend, but I want this symbol to appear on my legend.

  Re: Chart Legend Showing Symbols
Posted by Peter Kwan on May-23-2012 01:15
Hi Rob,

If you would like a line without symbols to show on the chart, please add the line without the symbol.

If you would like a legend to contain a symbol but not displayed on the chart, please add a layer that contain the symbol but not displayed on the chart (eg. has no data).

For example:

#add a line that does not have the symbol and does not have the legend entry
$TotalLayerLabel = $c->addLineLayer($DataY,$Color,$TrendLabel);
$TotalLayerLabel->setXData($DataX);
$TotalLayerLabel->setLegendMode(NoLegend);

#add a layer that does not display on the chart but have a legend entry with a symbol
$LegendLayer = $c->addLineLayer(null,$Color,$TrendLabel);
$getDataSetObj = $LegendLayer->getDataSet(0);
$LegendLayer->setDataSymbol($Symbol,14);

Hope this can help.

Regards
Peter Kwan