Chart Styles

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Chart Styles

armpersonals
Hi Folks,
I am facing difficulties on applying styles on Chart. My requirement is customize the chart color and categories label font, color and size. Could you please help me on this?

--Ariram
Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

gk_brown@verizon.net
What type of chart(s) are you using?

On Jun 10, 2011, at 5:57 AM, armpersonals wrote:

> Hi Folks,
> I am facing difficulties on applying styles on Chart. My requirement is
> customize the chart color and categories label font, color and size. Could
> you please help me on this?
>
> --Ariram
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Chart-Styles-tp3047996p3047996.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

armpersonals
Pie Charts and Bar Charts
Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

gk_brown@verizon.net
It doesn't look like either of those skins currently provide a style for configuring those styles.

Since the charting skins are backed by JFreeChart, I'd suggest taking a look at the JFreeChart docs to see how those styles can be adjusted. Then you can create a patch that adds support for them to biz.ixnay.pivot.charts.skin.jfree.BarChartViewSkin and biz.ixnay.pivot.charts.skin.jfree.PieChartViewSkin. The source code for these classes is located here:

http://code.google.com/a/apache-extras.org/p/pivot-jfree/source/browse/#svn%2Ftrunk%2Fprovider%2Fsrc%2Fbiz%2Fixnay%2Fpivot%2Fcharts%2Fskin%2Fjfree

G


On Jun 10, 2011, at 8:24 AM, armpersonals wrote:

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

Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

bentoucour
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
Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

Roger and Beth Whitcomb
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.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Chart Styles

bentoucour
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
Reply | Threaded
Open this post in threaded view
|

RE: Chart Styles

Roger Whitcomb-2
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:[hidden email]]
Sent: Monday, January 13, 2014 7:44 AM
To: [hidden email]
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.