|
Re: Legend entries for curve fitting lines [message #847020 is a reply to message #846807] |
Mon, 16 April 2012 23:50 |
|
Mike,
What I would do is set the marker visible and then just set its size to
0. Change the marker to be a rectangle. Take a look at the attached.
Jason
On 4/16/2012 3:24 PM, Mike Wulkan wrote:
> I have line charts for which I would like to NOT show the line and NOT
> show the markers but I do want to show the curve fitting line for the
> series.
> This works fine except that since the lines and markers are turned off,
> the legend entry for the series has no icon to match with the curve
> fitting line. (I set the color of the curve fitting line to the same
> color as the series color). So basically the legend is useless.
> Is there a way to force the legend to show the icon for the series even
> if the series visibility is turned off? If not can I put my own image in
> there?
>
> Thanks
> Mike
|
|
|
|
|
Re: Legend entries for curve fitting lines [message #847692 is a reply to message #847567] |
Tue, 17 April 2012 15:03 |
|
Mike
The color is easy. Just add this script:
var currentColor;
function beforeDrawFittingCurve( curveFitting, icsc )
{
curveFitting.getLineAttributes().setColor(currentColor);
}
function beforeDrawDataPoint( dph, fill, icsc )
{
currentColor = fill;
}
the Curve gets drawn after drawing the series but before the next
series, so just store the color in the beforeDrawDataPoint and use it in
the beforeDrawFittingCurve event. You can set the scale manually with a
script like
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
yscale = yAxis.getScale();
yscale.setStep (10);
yscale.setMin( NumberDataElementImpl.create(1.5) )
yscale.setMax( NumberDataElementImpl.create(170) )
yAxis.setScale(yscale);
}
Jason
On 4/17/2012 8:30 AM, Mike Wulkan wrote:
> Also is there a way to automatically use the series color for the curve
> fitting line? I am currently just hard-coding the color but I'd rather
> set it based on the palette color assigned to the series.
|
|
|
|
Re: Legend entries for curve fitting lines [message #847790 is a reply to message #847745] |
Tue, 17 April 2012 16:50 |
|
Mike,
The curve renderer is actually a spline function on the data points, so
I do not know an easy way to do what you want. You can get access to
all the data points in the after dataset filled script and possibly come
up with your own scale at that point.
Jason
On 4/17/2012 11:59 AM, Mike Wulkan wrote:
> Thanks again Jason. The color solution is perfect.
> As for the scale, yes I realized that you can programatically set the
> min/max however what I need is a way to determine what those values are
> based on the curve fitting line; ie., the min and max values of the
> computed curve fitting line rather than actual data points. If there is
> an easy answer to this then I would like to know, however please
> consider this a lower priority for yourself as I am starting to lean
> towards not hiding the raw data after all for this specific application.
> But I would still like to know how this can be done for future reference.
>
> Thanks
> Mike
|
|
|
Powered by
FUDForum. Page generated in 0.04539 seconds