|
Autoscale |
Posted by Brian C on Jun-24-2015 19:00 |
|
I am adding two lines to my line graph with the .addMark method.
At times my data points fall far enough away at times and the marks do not show up on the chart using the autoscale method.
Is there I was I can have the value(s) of the .addMark lines be considered when calling the autoscale method? |
Re: Autoscale |
Posted by Peter Kwan on Jun-24-2015 19:36 |
|
Hi Brain,
ChartDirector will only consider the data in the layers when auto-scaling the axis. To include
the mark values in auto-scaling, you may add the mark values as a transparent layer to the
chart. For example, in Java/C#:
//Just some dummy x-coordinates already in the chart, so it would not affect auto-scaling
//If you are using using x-coordinates (no Layer.setXData in your code), just set
//dummyXCoor to null or an empty array
double[] dummyXCoor = { myXCoor[0], myXCoor[0] };
//Add the values you want auto-scaling to include
double[] dummyYCoor = {myMarkValue1, myMarkValue2 };
c.addScatterLayer(dummyXCoor, dummyYCoor, "", Chart.SquareSymbol, 1,
Chart.Transparent, Chart.Transparent);
Hope this can help.
Regards
Peter Kwan |
Re: Autoscale |
Posted by Donavon on May-13-2016 01:06 |
|
Hello Peter.
Do you have an example of how to do this in perl?
Thank You,
~Donavon |
Re: Autoscale |
Posted by Peter Kwan on May-13-2016 21:55 |
|
Hi Donavon,
The same code is Perl is:
#Just some dummy x-coordinates already in the chart, so it would not affect auto-scaling
#If you are using using x-coordinates (no Layer.setXData in your code), just set
#dummyXCoor to a reference to an empty array
my $dummyXCoor = [ $myXCoor->[0], $myXCoor->[0] ];
#Add the values you want auto-scaling to include
my $dummyYCoor = [ $myMarkValue1, $myMarkValue2 ];
$c->addScatterLayer($dummyXCoor, $dummyYCoor, "", $perlchartdir::SquareSymbol, 1,
$perlchartdir::Transparent, $perlchartdir::Transparent);
Hope this can help.
Regards
Peter Kwan |
Re: Autoscale |
Posted by Donavon on May-14-2016 05:14 |
|
Thank You!!! |
|