RE: Gradient on each bar rather than across entire graph
"Chris McKay" <[email protected]> Mon, 13 Sep 2004 14:28:11 +1200
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
You could probably do this with a custom renderer. It would be actioned on
every bar drawn though.
So for instance I changed the color of a line point if it fell within a
certain range with a PreAxisValueRenderListener.
public void preRender( AxisValueRenderEvent axisValueRenderEvent )
{
//---keep the current paint around
Paint currentPaint=
axisValueRenderEvent.getGraphics2D().getPaint();
axisValueRenderEvent.getGraphics2D().setPaint(
this.forecastPaint );
// overwrite color if range test
double value =
axisValueRenderEvent.getiAxisChartDataSet().getValue(
axisValueRenderEvent.getDataSetIndex(), axisValueRenderEvent.getValueIndex()
);
if (value > loRange && value < hiRange) {
axisValueRenderEvent.getGraphics2D().setPaint(
this.inRangePaint );
}
//---reset the current Paint
axisValueRenderEvent.getGraphics2D().setPaint(
currentPaint );
}
}
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf
> Of Travis Reeder
> Sent: Monday, 13 September 2004 1:12 p.m.
> To: [email protected]
> Subject: [jCharts-users] Gradient on each bar rather than
> across entire graph
>
> Is there any way to make a GradientPaint applied separately
> to each bar rather than across the entire graph?
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one
> of 170 Project Admins to receive an Apple iPod Mini FREE for
> your judgement on who ports your project to Linux PPC the
> best. Sponsored by IBM.
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> jCharts-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jcharts-users
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php