You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by bentoucour <be...@gmail.com> on 2014/01/10 11:40:39 UTC

Re: Chart Styles

Hi,

This does not look like an easy fix. 

For instance, setting the chart backgroundColor looks like basic
requirement. The property is defined but cannot be used in BXML as only the
Color setter is defined in the ChartViewSkin parent class. I tried and had a
"Unable to coerce java.lang.String to class java.awt.Color" error - which I
believe is expected in this case. I manage to workaround that in my Java
class - but it's kind of ugly.

For the chart series color, it's not clear how to implement a solution. Is
it about changing the first series color (which I'm going to do for my
personal usage) or all of them... The latter looks more complex... do you
handle list type properties?

Ben



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Chart-Styles-tp3047996p4022823.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

RE: Chart Styles

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Alright, I get it.  Seems like there should be a way that you could specify any one of them, without having to make a separate method for each index (by passing the index as well as the color).  But, at the moment I can't think of how it would look.  But, if you're still in need of this, I will look into it....

~Roger

-----Original Message-----
From: bentoucour [mailto:benjamin.hattab@gmail.com] 
Sent: Monday, January 13, 2014 7:44 AM
To: user@pivot.apache.org
Subject: Re: Chart Styles

Hi Roger,

I'm fairly new here. I haven't raised a JIRA issue for it.

Yes, I was using the JFreeChart wrapper library. Especially:
biz.ixnay.pivot.charts.skin.jfree.LineChartViewSkin.java.

To solve one of my problems, I added a "firstSeriesColor" parameter with getter/setter and these 2 lines in the createChart method:

  CategoryItemRenderer renderer = plot.getRenderer();
  renderer.setSeriesPaint(0, firstSeriesColor);

Then, I paint my charts from my main window class by calling:
myChartView.setStyles(map)

I know it's kind of a quick and dirty fix but that's all I could think of for the time I had for this. 

To be clear, I'm trying to implement a dynamic chart solution for a monitoring tool (similar to what JConsole has). I don't have real need for fancy styles, only chart colors.

Thanks,
Ben



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Chart-Styles-tp3047996p4022825.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.



Re: Chart Styles

Posted by bentoucour <be...@gmail.com>.
Hi Roger,

I'm fairly new here. I haven't raised a JIRA issue for it.

Yes, I was using the JFreeChart wrapper library. Especially:
biz.ixnay.pivot.charts.skin.jfree.LineChartViewSkin.java.

To solve one of my problems, I added a "firstSeriesColor" parameter with
getter/setter and these 2 lines in the createChart method:

  CategoryItemRenderer renderer = plot.getRenderer();
  renderer.setSeriesPaint(0, firstSeriesColor);

Then, I paint my charts from my main window class by calling:
myChartView.setStyles(map)

I know it's kind of a quick and dirty fix but that's all I could think of
for the time I had for this. 

To be clear, I'm trying to implement a dynamic chart solution for a
monitoring tool (similar to what JConsole has). I don't have real need for
fancy styles, only chart colors.

Thanks,
Ben



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Chart-Styles-tp3047996p4022825.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Chart Styles

Posted by Roger and Beth Whitcomb <Ro...@rbwhitcomb.com>.
Let me look at it a little bit -- I assume you're talking about the 
JFreeChart wrapper library?!  I'm doing some other work in there to add 
some other chart/meter types to Pivot, so let me see what I can see.  
Did you have a JIRA issue already about this (can you refresh my memory)?

Thanks,
~Roger

On 1/10/14 2:40 AM, bentoucour wrote:
> Hi,
>
> This does not look like an easy fix.
>
> For instance, setting the chart backgroundColor looks like basic
> requirement. The property is defined but cannot be used in BXML as only the
> Color setter is defined in the ChartViewSkin parent class. I tried and had a
> "Unable to coerce java.lang.String to class java.awt.Color" error - which I
> believe is expected in this case. I manage to workaround that in my Java
> class - but it's kind of ugly.
>
> For the chart series color, it's not clear how to implement a solution. Is
> it about changing the first series color (which I'm going to do for my
> personal usage) or all of them... The latter looks more complex... do you
> handle list type properties?
>
> Ben
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Chart-Styles-tp3047996p4022823.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>
>