Welcome Guest Search | Active Topics |

Hide data series in legend
msbair
#1 Posted : Monday, July 30, 2012 8:28:15 AM(UTC)
Rank: Member

Groups: ExpiredLicense, Registered
Joined: 6/12/2012(UTC)
Posts: 15

Thanks: 4 times
Was thanked: 0 time(s) in 0 post(s)
Hello,

Does anyone know of a way to hide a data series in the legend? I'm adding some dummy series to my chart and I do not want them to show up in the legend.

Thanks!
Dragan
#2 Posted : Monday, July 30, 2012 8:30:59 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

You can try using custom legend:

http://www.jqchart.com/SamplesAspNetMVC/ChartFeatures/CustomLegend

Best Regards,
Dragan Matek
jqChart Inc.
msbair
#3 Posted : Monday, July 30, 2012 8:52:40 AM(UTC)
Rank: Member

Groups: ExpiredLicense, Registered
Joined: 6/12/2012(UTC)
Posts: 15

Thanks: 4 times
Was thanked: 0 time(s) in 0 post(s)
Great. Thanks!

Is there a page in the documentation that displays all custom legend options? I accidently posted this question under MVC, but I'm using jquery. I'm trying to build the custom legend but I'm getting errors and the display is not as expected (e.g. text color).

legend: { location: 'right', textFillStyle: '#ffffff', customItems: new Array({ text: "test1"}) },

I would expect the text to display #fffffff, but it is displaying #000. Are there additional items to set in the "new Array()" object?

Thanks.
Dragan
#4 Posted : Monday, July 30, 2012 9:05:32 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

Custom legend is still undocumented. There is only sample.

The available options of the custom items are "text" and "marker".

You can specify the fillStyle of the text with:

Code:
text: { text: 'test1', fillStyle: '#ffffff' },


Your test sould look like:

Code:
legend: {
                   location: 'right',
                   customItems: [
                        {
                            text: { text: 'test1', fillStyle: '#ffffff' },
                            marker: { fillStyle: 'red' }
                        }
                    ]
                },
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.101 seconds.